Diff between C++ and java?
Answers were Sorted based on User's Feedback
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 |
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 |
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 |
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 |
Answer / shyam kumar
in java we must need atleast one class to define our code
Is This Answer Correct ? | 4 Yes | 2 No |
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 |
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 |
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 |
How many characters is 16 bytes?
In a container there are 5 components. I want to display the all the components names, how will you do that one?
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?
Why singleton is not thread safe?
Explain why wait(), notify() and notifyall() methods are in object class rather than in thread class?
where do we use init()
Is null == null in java?
What is an event?
Explain the difference between runnable and callable interface in java?
why ,we are using jsp and html.which one is better?
How many types of parsers are there?