Differences between C++ & Java

By the way , C++ is also an object oriented programming language , just like Java. But there are some important features wise differences , between C++ and Java.

Let’s have a glance at them :

C++ Jva
1 C++ is not a purely object-oriented programming language
, since its possible to write C++ programs without using a class or an object.
Java is purely an object – oriented programming language ,
since it’s not possible to write Java program without construction of class.
2 Pointers are available in C++. We cannot create and use pointers in Java
3 Allocation and deallocation memory is the responsibility of the programmer. Here its taken care by JVM
4 Automatic casting is available in C++. In some cases , implicit casting is available , but one should use casting when required
5 C++ has goto statements. Its forbidden in java.
6 Multiple inheritance feature is available in C++. No Multiple inheritance in Java , but one can achieve in using Interface 🙂
7 There are 3 access specifiers in C++:
1)private
2)protected
3)public
Java supports 4 access specifiers:
1)private
2)protected
3)public
4)default
8 There are constructors and destructors in C++ . Only Constructors are available.

These where some of the key points that differentiate between C++ and Java.

Feel free to comments.