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


Please Help Members By Posting Answers For Below Questions

Explain the different forms of polymorphism?

573


Why spring singleton is not thread safe?

576


Give few difference between constructor and method?

526


Explain constructors and types of constructors in java.

653


What is the difference between final, finally and finalize()?

554






what do you mean by stream pipelining in java 8? Explain

544


How does arraylist work in java?

539


EDS (Electronic Data Systems India Pvt Ltd) at Chennai on 16-12-2006.

8634


Is java jre still free?

543


What is a function argument in java?

524


What is application tier?

540


Do I need java on my computer?

536


What are the restriction imposed on a static method or a static block of code?

601


Can we define package statement after import statement in java?

567


What is meant by flickering?

660