Showing posts with label CPP and JAVA. Show all posts
Showing posts with label CPP and JAVA. Show all posts

Friday, February 17, 2012

Difference Between C++ and Java - Java Advantages over C++

Hello guys, Today I am going to discuss "Difference Between C++ and Java - Java Advantages over C++". Previously discussed difference between C and C++.



Difference Between C++ and Java
C++Java
1.Write once, compile anywhereWrite once, run anywhere / everywhere. Full support to Platform Independency.
2.C++ supports operator overloading for almost all operators.Not supported by Java ,the (+) and (+=) operators are automatically overloaded to concatenate strings, and to convert other types to string in the process.
3.C++ supports complex pointer concept.Java does not support pointers.
4.An array in C++ is not bounds checked.
An array in Java is bounds checked, but with extra runtime cost.
5.C++ full support to Multiple Inheritance concept.Java not direct support to multiple inheritance but implements by using interface concept.
6.Compatible with C source code.Not compatible with previous language like c,c++.
7.C++ does not support interface concept.Java supports interface concept.
8.Scope resolution operator supported by C++.Not used in Java.
9.Structure and Union used in C++.Not used in Java.
10.A class definition in C++ has a closing semicolon(;).
A class definition in Java looks similar to a class definition in C++, but there is no closing semicolon.
11. C++ supports destructors concept.Automatic garbage collection (can be triggered manually). Doesn't have the concept of Destructor.
12. C++ supports templates concept.Java does not support templates.
13. C++ supports GOTO statement.Not supported by Java.
14. C++ is more complex than Java.It is simpler than C++.
15. C++ doesn't have automatic garbage collector.In Java memory management through automatic garbage collector.

Hope, you like this post.