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
What is a flag variable?
Is array an object in java?
What is bytecode in java ?
what is the messsage u r going to get from an objectoriented programing?
Why do we use variables?
What is main method?
Can there be an abstract method without an abstract class?
Can an abstract class be a final class?
how can you catch multiple exceptions in java?
Explain the difference between transient and volatile in java?
What is thread life cycle?
Can we cast any other type to boolean type with type casting?
What is method in java ?
What is a numeric string?
Why is it called boolean?