Apart from being platform independent , what are the other features that makes Java a better approach than C++?
C++ was designed for systems and applications programming, extending the C programming language.
Java was created initially as an interpreter for printing systems.It is secure and highly portable.
Java is a object-oriented language that uses similar (but incompatible) syntax to C++.
1.C++ supports pointers whereas Java does not pointers. But when many programmers questioned how you can work without pointers, the promoters began saying "Restricted pointers.” So we can say Java supports Restricted pointers.
2. At compilation time Java Source code converts into byte code .The interpreter execute this byte code at run time and gives output .Java is interpreted for the most part and hence platform independent. C++ is run and compiled using compiler which converts source code into machine level languages so c++ is platform dependent.
3.Java uses compiler and interpreter both and in c++ their is only compiler
4.C++ supports operator overloading multiple inheritance but java does not.
5.C++ is more nearer to hardware then Java
6.Everything (except fundamental types) is an object in Java (Single root hierarchy as everything gets derived from java.lang.Object).
7.Java does is a similar to C++ but not have all the complicated aspects of C++ (ex: Pointers, templates, unions, operator overloading, structures etc..) Java does not support conditional compile (#ifdef/#ifndef type).
8.Thread support is built-in Java but not in C++. C++11, the most recent iteration of the C++ programming language does have Thread support though.
9.Internet support is built-in Java but not in C++. However c++ has support for socket programming which can be used.
10.Java does not support header file, include library files just like C++ .Java use import to include different Classes and methods.
11.Java does not support default arguments like C++.
12.There is no scope resolution operator :: in Java. It has . using which we can qualify classes with the namespace they came from.
13.There is no goto statement in Java.
14.Exception and Auto Garbage Collector handling in Java is different because there are no destructors into Java.
15.Java has method overloading, but no operator overloading just like c++.
16.The String class does use the + and += operators to concatenate strings and String expressions use automatic type conversion.
17.Java does not support unsigned integer.