Java Vs C++
- Java is pure object-oriented language because every statement in Java is written inside a class. In C++, the main() method is always written outside any class.
- In Java, all the data types except the primitive types are objects. Even the primitive data types can be encapsulated inside classes.
- Java does not support multiple inheritance but we can achieve by using interface.
- Java allows method overloading but does not support operator overloading.
- In C++, an array is a collection of elements where as in Java, arrays are real objects because you can allocate memory to an array using the new operator.
- In C++, the strings are end with null character but in java, Strings are real objects.