C++ vs Java

There are many differences and similarities between the C++ programming language and Java. A list of top differences between C++ and Java are given below:


  • Java doesn't support default arguments like C++.
  • Java does not support header files like C++. Java uses the import keyword to include different classes and methods.

C++ Example

File: main.cpp

using namespace std;
int main() {
   cout << "Hello C++ Programming";
   return 0;

Java Example

File: Simple.java

class Simple{
    public static void main(String args[]){
     System.out.println("Hello Java");
Related Tutorial
Follow Us
https://www.facebook.com/Rookie-Nerd-638990322793530 https://twitter.com/RookieNerdTutor https://plus.google.com/b/117136517396468545840 #