Differences between C, C++ and Java
C, C++ and Java are three different programming languages. C is the oldest programming language of the three. In fact, the other two are based on C. Still, each has its own advantages and disadvantages when compared with each other.
C |
C++ |
Java |
Based on Assembly Language |
Based on C |
Based on C and C++ |
Oldest |
Newer as compared to C |
Newest among the three |
Designed for systems and applications programming |
Designed for systems and applications programming |
General-purpose, concurrent, class-based, object-oriented programming language |
Developed by Dennis Ritchie in 1972 for Unix OS |
Developed by Bjarne Stroustrup Starting In 1979 At Bell Labs |
Developed by James Gosling from Sun Microsystems in 1991 |
Procedural Programming |
Object Oriented Programming |
Object Oriented Programming |
Top-down approach |
Bottom-up approach |
Bottom-up approach |
Compiled language |
Compiled language |
Interpreted language |
Dependent on Platform |
Dependent on Platform |
Independent of Platform |
Code executed directly |
Code executed directly |
Code executed by JVM |
Supports 32 keywords |
Supports 63 keywords |
Supports 50 defined keywords |
Supports union and structure data types |
Supports union and structure data types |
Does not support union and structure data types |
Supports pre-processor directives such as #include, #define |
Supports pre-processor directives such as #include, #define |
Does not support pre-processor directives such as #include, #define |
Supports header files |
Supports header files |
Uses packages |
Does not support Inheritance |
Supports Inheritance |
Does not support multiple inheritance |
Does not support Operator Overloading |
Supports Operator Overloading |
Does not support Operator Overloading |
Supports pointers |
Supports pointers |
Does not support pointers |
Compiled Code Translation |
Compiled Code Translation |
Interpreted Code Translation |
Uses malloc, calloc for storage allocation |
Uses new , delete for storage allocation |
Uses garbage collector for storage allocation |
Does not support multi-threading and interfaces |
Does not support multi-threading and interfaces |
Supports multi-threading and interfaces |
Does not support exception handling |
Supports exception handling |
Supports exception handling |
Does not support templates |
Supports templates |
Does not support templates |
Supports storage classes like auto, external etc. |
Supports storage classes like auto, external etc. |
Does not support storage classes like auto, external etc. |
Does not support Constructors or Destructors |
Supports Constructors or Destructors |
Does not support Constructors or Destructors |
Does not support Database Connectivity |
Does not support Database Connectivity |
Supports Database Connectivity |
Uses include statement for including the contents of screen |
Uses include statement for including the contents of screen |
Uses import statement for including the contents of screen |
Uses goto |
Uses goto |
Does not goto |
Add new comment