The purpose of learning a programming language is to become a better programmer i.e. to become more effective at designing and implementing new systems and at maintaining old ones.
C, C++ and Java are the most popular programming languages used today at a broad level. They have a pretty similar syntax for basic concepts. Most of the basic constructs like if statements, loops, function syntax, switch case statements and concepts like recursion are still valid. Many other concepts like the syntax for comments, and the idea of static class variables, also hold in both Java and C++.
Java uses the syntax of C and structure of C++ language.
This article summarizes the main differences among most popular programming languages C, C++ and Java..
Introduction to C, C++ and Java :
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.
[Read] Comparitive Study of Hello World Program in C , C++ and Java
Differences among C, C++, 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 |
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.
I tried to sum up mostly differences among these popular languages with this comparison table. Hope, this will be helpful to you.
Have Fun!
http://www.geeksforgeeks.org/database-connectivity-using-cc/
ReplyDeleteC++ supports database connectivity
Very useful
ReplyDeleteSimple and easy to understand
ReplyDeleteEasy and simple to understand
ReplyDeleteEasy and simple to understand
ReplyDeletenice article,easy and simple
ReplyDeletenice article ....thank you
ReplyDeletenice article ....thank you
ReplyDeleteEasy to remember
ReplyDeletevery simple explanation. Thanks
ReplyDeleteGood and Short work
ReplyDeleteVery easy way for learning
ReplyDeleteEasy way for learning
ReplyDeletevery helpful to students thank u so much
ReplyDeletevery helpful thank u and very easy and simple to understand
ReplyDeletegreat! article, thanks.
ReplyDeleteVery helped full material
ReplyDeleteWaooow!! Nice blog, this will be greatly helpful.
ReplyDeletetutorial for c++