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++:
Java supports 4 access specifiers:
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.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.