Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
27 views

12.diff BW Java and CPP

The document outlines key differences between C++ and Java, noting that C++ supports features like pointers, operator overloading, preprocessors, structures, unions, enums, functions, goto statements, coercions, global variables, templates, and default parameters that Java does not, while Java features garbage collection and supports multi-threading like C++ but avoids ambiguities by not directly supporting multiple inheritance.

Uploaded by

jaikumar_22
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
27 views

12.diff BW Java and CPP

The document outlines key differences between C++ and Java, noting that C++ supports features like pointers, operator overloading, preprocessors, structures, unions, enums, functions, goto statements, coercions, global variables, templates, and default parameters that Java does not, while Java features garbage collection and supports multi-threading like C++ but avoids ambiguities by not directly supporting multiple inheritance.

Uploaded by

jaikumar_22
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 1

What is the difference in between C++ and Java.

Java:
There are no pointers.
There is no Operator Overloading.
There are no preprocessors.
There are no Structures and Unions.
There are no Enums.
There are no Functions (only methods within class).
There is no goto statement. (In Java goto and const are reserved words but
Unused)
There are no Coercions (types should be converted explicitly)
There are no Global variables (variable is part of a class)
There are no Templates. (But present in latest versions)
There are no default parameters.
There is garbage collection.
There is multi-thread support.

C++:
There are pointers.
There is Operator Overloading
There are preprocessors.
There are Structures and Unions.
There are Enums.
There are functions.
There is goto statement.
There are Coercions.
There are Global variables
There are Templates.
There are default parameters.
There is no garbage collection.
There is support for multi-threading.

Java doesn’t support multiple inheritance directly to avoid


ambiguities.Java does operator overloading implicitly on ‘+’ for
concatenation of strings only.

You might also like