What are the differences between C++ and Java?



Following are the major differences between C++ and Java.

Java
C++
Java does not support pointers, unions, operator overloading and structure.
C++ supports pointers, unions, operator overloading and structure.
Java supports garbage collection.
C++ does not supports garbage collection.
Java is platform independent.
C++ is platform dependent.
Java supports inheritance except for multiple inheritance
C++ supports inheritance including multiple inheritances
Java is interpreted.
C++ is compiled.
Java does not support destructor
C++ supports destructors.

Advertisements