C, C++, and Java are all programming languages used for developing various programs and software.
All three programming languages have similar syntax for some of the basic concepts but still are different from each other in various aspects.
- Introduction to C
- Introduction to C++
- Introduction to Java
- Difference between C, C++ and Java
Introduction to C
- C language is a general purpose language and was developed in 1972
- C was developed by Dennis Ritchie
- It is a procedural oriented programming language.
- C was developed after BCPL to overcome its limitations and provide much more features.
- It was originally developed for building system softwares.
- C is a platform dependent language.
Introduction to C++
- C++ is an object oriented programming language developed by Bjarne Stroustrup in 1979.
- It uses various concepts of OOPs such as classes and objects, inheritance, encapsulation, data abstraction etc. to allow programming of complex real world problems.
- C++ posses features of both low level and high level programming language, thus is also known as intermediate language.
- Original name of C++ was “c with classes”.
- C++ is platform dependent language.
Introduction to Java
- Java is a high level programming language developed by James Gosling in 1991.
- Java was first known as oak language and was later renamed JAVA, its current name.
- It is based on C and C++ programming languages.
- It has removed a lot of unnecessary and unsecured features of C and C++ and has added a lot of new features to perform multiple function altogether in a single program.
- Byte code is generated after the java source code is interpreted.
- Byte code is platform independent which in turn make java platform independent language.
Difference between C, C++ and Java
Difference between C, C++ and Java are as follows
|Year of development||C was developed in 1972||C++ was developed in 1979||Java was developed in 1991|
|Name of developer||C was developed by Dennis Ritchie||C++ was developed by Bjarne Stroustrup||Java was developed by James Gosling|
|Successor of||C was developed after BCPL||C++ was developed after C||Java was developed after c++|
|Programming paradigm||C follows procedural programming paradigm||C++ follows object oriented programming paradigm||Java follows object oriented paradigm|
|Whether platform dependent or not?||C is platform dependent||C++ is platform dependent||Java is platform independent|
|Purpose||C was designed basically for programming applications and for system programming.||C++ was also designed for programming applications and for system programming.||Java was designed for class based, concurrent object oriented programming.|
|Programming approach||C uses top down approach of programming||C++ uses bottom up approach of programming||Java uses bottom up approach of programming|
|Number of keywords allowed||C language has 32 keywords||C++ language has 63 keywords||Java language has 50 keywords|
|Union and Structure||C supports Union and Structure both||C++ supports Union and Structure both||Java neither supports C nor C++|
|Concept of inheritance||C does not have any such concept||C++ supports various types of Inheritance||Java supports inheritance except multiple inheritance|
|Use of Pointers||C supports use of pointer variables||C++ also supports use of pointer variables||Java does not support use of pointer variables|
|Method of translating source code||C is a compiled language. Source code is compiled||C++ is also a compiled language. Source code is compiled.||Java is both compiled and interpreted language.|
|Method of storage allocation||C uses malloc and calloc for allocating storage||C++ uses new and delete to allocate storage.||Java uses garbage collector|
|Concept of constructors||No such concept||C++ supports constructors||Java supports constructors|
|Database connection||C does not provide mechanism for database connection||C++ does not provide any mechanism for database connection||Java provides mechanism for database connection|
|Class||C does not make use of classes||C++ makes use of classes||Java makes use of classes|
|Use of header files||C makes use of predefined header files||C++ makes use of header files||Java makes use of packages and not header files.|
|Applets||C does not support use of internet programming method such as Applet||C++ does not support use of internet programming method such as Applet||Java supports use of applets for the purpose of internet programming.|
|Use of Exception handling||C does uses exception handling for exception generated while execution of program.||C++ makes use of exception handling for handling various types of exceptions generated while execution of program.||Java makes use of exception handling in a very effective way to handle exceptions generated while execution of program.|
|Operator overloading||There is no such concept of operator overloading in C||C++ uses concept of operator overloading||There is no such concept of operator overloading in Java|
|Use of templates||There are no templates in C||C++ allows generic programming through use of templates||There are no templates in Java|
|Goto keyword||It supports Goto keyword||It supports Goto keyword||It does not uses Goto keyword|
|Including files and statements||C makes use of #include pre processor directive to include other files||C++ uses #include pre processor directive to include other files||Java makes use of import statement to include other files.|
|Enumerated data type||C supports use of enum data type||C++ supports use of enum data type||Java does not support use of enum data type|