What is the difference between C++ & Java?
Answer Posted / sowmya
Feature C C++ Java
Paradigms Procedural Procedural, OOP, Generic Programming OOP, Generic Programming (from Java 5)
Form of Compiled Source Code Executable Native Code Executable Native Code Java bytecode
Memory management Manual Manual Managed, using a garbage collector
Pointers Yes, very commonly used. Yes, very commonly used, but some form of references available too. No pointers; references are used instead.
Preprocessor Yes Yes No
String Type Character arrays Character arrays,
Feature C C++ Java
Paradigms Procedural Procedural, OOP, Generic Programming OOP, Generic Programming (from Java 5)
Form of Compiled Source Code Executable Native Code Executable Native Code Java bytecode
Memory management Manual Manual Managed, using a garbage collector
Pointers Yes, very commonly used. Yes, very commonly used, but some form of references available too. No pointers; references are used instead.
Preprocessor Yes Yes No
String Type Character arrays Character arrays, objects Objects
Complex Data Types Structures, unions Structures, unions, classes Classes
Inheritance N/A Multiple class inheritance Single class inheritance, multiple interface implementation
Operator Overloading N/A Yes No
Automatic coercions Yes, with warnings if loss could occur Yes, with warnings if loss could occur Not at all if loss could occur; msut cast explicitly
Variadic Parameters Yes Yes No
Goto Statement Yes Yes No
Is This Answer Correct ? | 18 Yes | 1 No |
Post New Answer View All Answers
Explain the different forms of polymorphism?
Why spring singleton is not thread safe?
Give few difference between constructor and method?
Explain constructors and types of constructors in java.
What is the difference between final, finally and finalize()?
what do you mean by stream pipelining in java 8? Explain
How does arraylist work in java?
EDS (Electronic Data Systems India Pvt Ltd) at Chennai on 16-12-2006.
Is java jre still free?
What is a function argument in java?
What is application tier?
Do I need java on my computer?
What are the restriction imposed on a static method or a static block of code?
Can we define package statement after import statement in java?
What is meant by flickering?