C is a general-purpose high level language that was originally developed by Dennis Ritchie in 1972 for the Unix operating system. C is a successor of B language which was introduced around 1970. C is a structured language which is easy to learn and produces efficient programs. it`s a top-down approach. It can handle low-level activities and can be compiled on a variety of computers. Today C is the most widely used System Programming Language.
C++ is a general purpose programming language developed by Bjarne Stroustrup starting in 1979 at Bell Labs,designed to make programming more enjoyable
for the serious programmers.C++ is a superset of the C programming language.
In addition to the facilities provided by C, C++ provides flexible and efficient facilities for defining new types.The key concept in C++ is class. A class is a user defined type.
Java is a programming language created by James Gosling from Sun Microsystems in 1991. The first publicly available version of Java (Java 1.0) was released in 1995. The Old name of Java was Oak. Java is now taken by oracle corporation.The acquisition of Sun Microsystems by Oracle Corporation was completed by Oracle in January 2010.The current version of Java is Java 1.7
(Java 7 ). Java is a Programming language as well as a Platform itself.
Difference Between C, C++ and Java:
The main difference between c++ and java is that C++ does not support database connection while Java supports database connection.The other differences can be summarized as :
Aspects | C | C++ | Java |
---|---|---|---|
Developed Year | 1972 | 1979 | 1991 |
Developed By | Dennis Ritchie | Bjarne Stroustrup | James Gosling |
Successor of | BCPL | C | C(Syntax) & C++ (Structure) |
Paradigms | Procedural | Object Oriented | Object Oriented |
Platform Dependency | Dependent | Dependent | Independent |
Keywords | 32 | 63 | 50 defined (goto, const unusable) |
Datatypes : union, structure | Supported | Supported | Not Supported |
Pre-processor directives | Supported (#include, #define) | Supported (#include, #define) | Not Supported |
Header files | Supported | Supported | Use Packages (import) |
Inheritance | No Inheritance | Supported | Multiple Inheritance not Supported |
Overloading | No Overloading | Supported | Operator Overloading not Supported |
Pointers | Supported | Supported | No Pointers |
Code Translation | Compiled | Compiled | Interpreted |
Storage Allocation | Uses malloc, calloc | Uses new , delete | uses garbage collector |
Multi-threading and Interfaces | Not Supported | Not Supported | Supported |
Exception Handling | No Exception handling | Supported | Supported |
Templates | Not Supported | Supported | Not Supported |
Storage class: auto, extern | Supported | Supported | Not Supported |
Destructors | No Constructor or Destructor | Supported | Not Supported |
Database Connectivity | Not Supported | Not Supported | Supported |
Comparing C, C++ and Java Program:
Java is an Interpreted language while C, C++ are compiled languages.We all know what a compiler does. It takes your code & translates it into the machine-level code. The code is ‘compiled’. While with Java, the code is first transformed into the bytecode and then this bytecode is executed by the JVM.
Also, C uses the top-down approach while C++ , Java uses the bottom-up approach.In C, formulating the program begins by defining the whole and then splitting them into smaller elements. JAVA,C++ follows the bottom-up approach where the smaller elements combine together to form the whole.
No comments:
Post a Comment