Diff between C++ and java?

Answers were Sorted based on User's Feedback



Diff between C++ and java?..

Answer / sivasubramanian.k

In C++ there is concept of pointers for memory management
but there is garbage collecor in Java which automatically
allocates and frees memory after the particular scope in
the code...In C++ it supports concept of multiple
inheritance but for java instead of multiple inheritance
there is concept of interface...

Is This Answer Correct ?    11 Yes 2 No

Diff between C++ and java?..

Answer / pathi

in java we must need atleast one class to define our
code...but in c++ we can also define it without a class..

Is This Answer Correct ?    3 Yes 0 No

Diff between C++ and java?..

Answer / ruchi

In c++,there is destructor but in java there is no
destructor.
c++ programs are faster than java programs.
c++ supports multiple inheritance whereas java does not.
in c++ , we can write programs without classes but in java
we have to use classes .

Is This Answer Correct ?    4 Yes 1 No

Diff between C++ and java?..

Answer / blue arkos

Java is interpreted. This means that java source code is
compiled once, but it has to be interpreted by the JVM (Java
Virtual Machine) everytime the programme is executed. On the
other hand, C++ is not. C++ source code will compile once,
but it is NOT interpreted everytime the programme runs,
because C++ code is converted directly to machine language
instructions (in the machine that the C++ programme was
compiled). This is the reason why C++ is NOT portable.

Java is portable. This means that any Java programme can be
executed in any machine, provided that it has a JVM. C++
applications can only be executed in the machine in which
they were created (or in some cases, in similar machines
e.g. a C++ application that was writen in a computer under
the Windows XP Operating System, it will probably run in
other computers with Windows XP and maybe in computers with
other Windows versions, but certainly not in a cell phone).

That's why Java programmes are slower. They have to be
interpreted at runtime and this yields some overhead. This
is the efficiency - portability trade-off. Java applications
are portable, but C++ applications are executed faster.

Finally, there are some ways to overcome this trade-off from
both languages' point of view, but this is not the subject
of the question.

Is This Answer Correct ?    4 Yes 1 No

Diff between C++ and java?..

Answer / shyam kumar

in java we must need atleast one class to define our code

Is This Answer Correct ?    4 Yes 2 No

Diff between C++ and java?..

Answer / raja pavan kumar

OOPS is a aprroach or style
C++ is a tool to implement this approach
Java also another tool to implement this approach
there is no link between C++ and Java
C++ is partially OOPS.
Java is completely OOPS

Is This Answer Correct ?    1 Yes 1 No

Diff between C++ and java?..

Answer / gyana

Java is simply different from C++.Because it do some
modification to c++ then after it publish..So there are 6
major difference here i can explain.These are

1-java doesn't support predessors.Where as C++ support this.
2-Java doesnot support Multiple inheritance however it use
this by using interface.
3-Java doesn't contain any pointer value.
4-Java have no template class.
5-Java doesn't contain any datatype such as
struct,enum,union.
6-Java have no Go to keyword.

Above these points are not supported by java , but
supported by c++.So these are the difference between java
and c++.

Is This Answer Correct ?    0 Yes 1 No

Diff between C++ and java?..

Answer / sakthivel(gceb)(n.p)pollachi

c++ is an object oriented language. but java is pure object
oriented language.in java all properties are based on
classes and objects.but in c++ we can write and execute the
program with out using class.

Is This Answer Correct ?    1 Yes 3 No

Diff between C++ and java?..

Answer / hanu

Java is Pure Object Oriented while C++ is not .

Is This Answer Correct ?    1 Yes 6 No

Post New Answer

More Core Java Interview Questions

Can memory leak in java?

0 Answers  


What is boolean logic?

0 Answers  


What is thread life cycle in java?

0 Answers  


Assume a thread has lock on it, calling sleep() method on that thread will release the lock?

0 Answers  


Why isn’t there operator overloading?

0 Answers  






What is a text string?

0 Answers  


What is rmi and steps involved in developing an rmi object?

0 Answers  


What is the difference between a switch statement and an if statement?

0 Answers  


how to handle exceptions in core applications?

2 Answers   CSS,


What are nested classes in java?

0 Answers  


what is webservices

5 Answers   Consultancy, Mind Tree,


What are the traverses in Binary Tree?

2 Answers   Adobe, Infosys,


Categories