What are the similarities and differences between Java and C/C++?

Features

Java

C/C++

PointerNoYes
Operator OverloadNoYes
PreprocessorsNoYes
Structures, UnionsNoYes
EnumsNoYes
FunctionsNo (only methods within classes)Yes
Goto statementNoYes
Automatic CoercionsNo (types should be converted explicitly)Yes
Global VariablesNo (variable is a part of a class)Yes
TemplatesNoYes
Private, Protected, PublicYesYes
InheritanceNoYes
Default parametersNoYes
Garbage CollectionYesNo
Multi-thread support YesNo
Multiple InheritanceYes. Supports only interface inheritance and not implementation inheritance!Yes
Exception Handling

Yes. try/catch must be defined if the function declares that it may throw an exception.

Yes. You may not include the try/catch even if the function throws an exception

Function Overload YesYes
InternationalizationYesYes

 

This Question is not yet answered!

 
 

Related Answered Questions

 

Related Open Questions