what is the difference between c++ and java?

nisha134's Avatar
reply me...thanks in advance..
neeraj_77's Avatar, Join Date: Aug 2011
Go4Expert Member
Within a software engineering point of view, Java seems to be the more robust programming language among Java/C++. The language catches some of the ugly design and implementation features that C++ offers. The memory management based on garbage collection makes code more robust and might allow faster development. Concerning highly optimized code, C++ may be the choice.
raixyz's Avatar
The main difference between c++ and java is that 'C++ does
not allow persistence because it does not support database
connection while Java allows persistence because it
supports database connection'.
archanababu's Avatar
Java written in class modules but c++ is an Object Oriented Programming
Trinity's Avatar, Join Date: Nov 2011
Go4Expert Member
Major Broad differences between Java and C++ are:

1. Portability - C++ sources are required to be compiled for a particular system, to execute on that system only, whereas Java compiles to a byte code which just needs a JVM (Java virtual machine), and hence, can run the byte code compiled for any platform.

2. Memory management - C++ programing expects programmers to manage the memory allocated on heap using new and delete(), whereas Java handles the memory cleanup itself internally. Java programmer does not need to worry about freeing up any memory allocated.

3. Organization - C++ generally have individual classes which can be included in namespaces in case of same class names, however Java classes work in packages i.e. each Java class must be a part of a package and each class is identified by its package. i.e. absolute class name would include the package name.

4. UI - In general Java is considered better and efficient for UI handling.

There might be many other differences, but above mentioned are the major ones as far as I've come across.
jhonden's Avatar, Join Date: Sep 2011
Ambitious contributor
Java is platform independent language and C++ is not moreover Java does not support type definition or pre processor. Java supports classes which PHP doesn't.