Java Programming

Difference between C++ and Java(C++ vs Java)

Both C++ and Java language are based on the object-oriented concept but there are some differences which separate both the programming languages. In this post, I will try to differentiate the C++ language and Java Language.

Before diving in this article, please refer to Difference between C and Java (C vs Java)

C++ Vs Java

  C++ Java
Platform Dependency C++ is platform dependent language. Java is platform independent language.
Overloading Feature C++ does support operator overloading. Java does not support operator overloading feature.
Use of Pointers C++ supports pointer. So we may store the address of any variable in a pointer variable. Java does not support pointer variable.
Header Files C++ contains various libraries which we may use using by including header files. Java does not support any header files.
Template C++ has the feature to implement template classes. Java does not support any template class.
Level  of Language C++ language is the language which works on both high level as well as machine level. Java language works only in high-level language. So it is fully object-oriented language.
Thread Support C++ doesn’t have any thread feature. Java has a feature of threads.
Inheritance C++ has the features of multiple inheritances. Java doesn’t have the feature of multiple inheritances.
User-defined data type Struct and union data types are available in C++. Struct and union data types features are not available in Java.
Code compiler C++ supports compiler. Java supports interpreter as well as the compiler.
Input/Output Inputs and outputs are taken using cout and cin features. Inputs and outputs are taking using System.out.

Also read

 

Leave a Reply