+ 2
What is the main difference between C++ and Java ?
Since both are object oriented programming languages. And both supports features like :- inheritance , polymorphism etc.. then what makes difference between java and c++..
8 Answers
+ 3
It isn't meant to be an interpreted language. It is meant to be reasonably close in speed to compiled languages and quickly ported to new computers. Strictly interpreted languages are much slower in execution than compiled languages, but quick to port. Strictly compiled languages take a huge effort to port. Java is very nicely balanced to have the best of both worlds.
+ 2
C++ is compiled, Java is interpreted.
Besides that, pointers.
+ 2
@jacob pembleton if it is interpreted then what is the use of JVM ? If it is an interpreter, then what about JIT compiler that exist inside the JVM?
+ 2
It gets compiled into a bytecode then interpreted.
+ 2
Thanks for answer.. @Mr. john wells
+ 1
Java took a more principled approach with its library.
It doesn't require header files.
It is garbage collected. C++ later invented smart pointers.
It hides/automates pointers. There is a fixed rule what goes where in memory.
It has a top type for objects.
It uses packages instead of friend keyword.
Multiple inheritance is more limited in Java still.
Type parameters are more expressive, but require auto boxing.
0
@jacob sir Then that shows that it is not perfectly interpreted based language..
0
@Jacob Pembleton Java's byte code is compiled to native machine code when possible by the JVM's JIT