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.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
VulpesRank #55 · 29.2K reputationPosted Oct 11, 2012, 3:03 AM EDT
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.
shanmukha kommoju3 reputationPosted Oct 11, 2012, 7:56 AM EDT
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