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

How many characters is 16 bytes?

0 Answers  


In a container there are 5 components. I want to display the all the components names, how will you do that one?

0 Answers  


What happens when a main method is declared as private?

22 Answers   DELL, Infosys, L&T, Sun Microsystems,


From the two, which would be easier to write: synchronization code for ten threads or two threads?

0 Answers  


Why singleton is not thread safe?

0 Answers  


Explain why wait(), notify() and notifyall() methods are in object class rather than in thread class?

0 Answers  


where do we use init()

2 Answers  


Is null == null in java?

0 Answers  


What is an event?

2 Answers  


Explain the difference between runnable and callable interface in java?

0 Answers  


why ,we are using jsp and html.which one is better?

2 Answers   Photon,


How many types of parsers are there?

0 Answers  


Categories