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 |
whays is mean by inner class?
What is a nested class?
How to find the index of the largest number in an arraylist java?
Can an interface be defined inside a class?
Is it possible to cast an int value into a byte variable? What would happen if the value of int is larger than byte?
Explain where variables are created in memory?
What is the purpose of an interface?
Can you call a private data from an inner class?
Does java return by reference?
When you declare a method as abstract method ?
What is difference between path and classpath?
Is object a data type?