Tuesday, April 10, 2007

How is Java different from C++?

Java is a platform independent, object oriented language while C++ is having some of its features from C, which is a procedural language so it is not pure object oriented. Even Java is not 100% pure object oriented.

1. Pointers are supported in C++ while not in Java. The memory management is done automatically with help of part of JVM called Garbage Collector.
2. Multiple inheritance is not supported in Java but supported in C++.
3. There are no structures and unions in Java.
4. There is no scope resolution operator in Java (::).
5. There are no destructors in Java like C++.
6. There is no virtual keyword in Java because all non-static method use dynamic binding.

1 comments :

Anonymous said...

A key distinction might be that Java is compiled into byte code and then executed in a virtual machine with automatic memory management. C++ is compiled into native code.

 

Disclaimer
Interview Questions On Java,Java EE Copyright © 2017. Reads: best tracker