C++ AND JAVA
C++ supports OOP, while Java is OOP out of the box.
C++ supports multiple class inheritance, while Java only gives you a single class inheritance, but solves the multiplicity via interfaces.
C++ has got a pointers, and can directly manipulate/violate the memory addresses.
Java is a type-safe language, and you have no availability of pointers in Java. They're present in the background, but not on the scene.
Generics in Java, and templates in C++
Java does not include structures or unions.
Java does not support destructors but adds a finalize() method.
All the code in Java program is encapsulated within classes therefore Java does not have global variables or functions.
C++ requires explicit memory management, while Java includes automatic garbage collection.
No comments:
Post a Comment