C++ is platform-dependent.
Java is platform-independent.
· C++ is mainly used for system programming.
Java is mainly used for application programming. It is widely used in window, web-based, enterprise and mobile applications.
· C++ supports multiple inheritance.
Java doesn't support multiple inheritance through class. It can be achieved by interfaces in java.
· C++ supports pointers. You can write pointer program in C++.
Java supports pointer internally. But you can't write the pointer program in java. It means java has restricted pointer support in java.
The difference between c++ and Java c++ is a procedural and object oriented programming language c++ is not compulsory a class and the language is platform dependent and Java is pure object oriented programming language and in Java class is compulsory without class not compile code and java is a platform independent language.
The java language is follow "wora" statement write once run anytime..
The main difference is that
JAVA is 99% object oriented programming language and
C++ is partially object oriented programming language
In java 1% exception is handled by
In C++ we can make programme without class and can follow top to bottom approach of procedure oriented programming language
One more important difference is that in C++ their is compiler but in JAVA their are both compiler and interpreter .
Main differences are that
Java is provides platform independancy by JVM and byte code, while C++ is not ensure for platform independancy
Pointer is used in C++ that violet private data security, while Java not allowed pointer. But, allow reference variable. So, provides reference and also maintain security.
3. C++ allows multiple inheritance which cause problem while have same functions in two different class that is base class for derived class, While Java eliminates multiple interitance and allow it to only by interface. So, not ambiguity is created.
I hope it will be helpful for know difference between C++ and Java.