Differences Between C , C++, and Java
Table Comparing C, C++ and Java:
This table is a summary of the differences found in the article.
Feature
|
C
|
C++
|
Java
|
Programming Approach
|
Procedural Programming Language
|
Procedural, OOP, Generic Programming languages
|
OOP, Generic Programming languages.
|
Compiled Source Code
|
Executable in Native Code
|
Executable in Native Code
|
Compiled into Java byte code
|
Memory management
|
Manual Done,
|
Manual Done,
|
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
(Conversion)
|
Yes, with warnings if loss could occur
|
Yes, with warnings if loss could occur
|
Not at all if loss could occur; must cast explicitly
|
Variadic Parameters
|
Yes
|
Yes
|
No
|
Goto Statement
|
Yes
|
Yes
|
No
|