Hi Friends
What is the difference between java and c++?
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
shanmukha kommojuPosted Oct 11, 2012, 11:56 AM
c++:
it is a object oriented language, but not platform independent,ieC++ is platform depending meaning that it has to be recompiled for each platform you want it to work on.c++ code is different for each platform(widows,unix,linux)
- compared to java, c++ does'nt consists security
- c++ follows MZ format for windows to convert high to low level language in windows and for linux its different so it is platform dependent
java:java is platform independent language meaning java has byte code, java byte code is like a write once and run any where type.
basically java consists compiler and interpriter
VulpesPosted Oct 11, 2012, 7:03 AM
Off the top of my head, some of the main differences are listed below:
1. C++ is compiled directly to native code whereas Java is compiled to an intermediate byte code which is then converted 'on the fly' to native code for the underlying platform.
2. C++ supports multiple inheritance but Java supports only single inheritance.
3. All methods in Java are virtual by default but non-virtual by default in C++.
4. C++ supports pointers but Java does not.
5. C++ supports passing parameters by reference but Java does not.