Differences among C, C++ and Java Programming Languages : C vs C++ vs Java


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 Year1972 19791991
Developed ByDennis RitchieBjarne Stroustrup James Gosling
Successor of BCPLCC(Syntax) & C++ (Structure)
ParadigmsProceduralObject OrientedObject Oriented
Platform DependencyDependentDependentIndependent
Keywords326350 defined (goto, const unusable)
Datatypes : union, structureSupportedSupported Not Supported
Pre-processor directivesSupported (#include, #define)Supported (#include, #define)Not Supported
Header filesSupported Supported Use Packages (import)
InheritanceNo InheritanceSupportedMultiple Inheritance not Supported
OverloadingNo OverloadingSupportedOperator Overloading not Supported
PointersSupportedSupportedNo Pointers
Code TranslationCompiledCompiledInterpreted
Storage AllocationUses malloc, callocUses new , delete uses garbage collector
Multi-threading and InterfacesNot SupportedNot SupportedSupported
Exception HandlingNo Exception handlingSupportedSupported
TemplatesNot SupportedSupported Not Supported
Storage class: auto, externSupportedSupportedNot Supported
DestructorsNo Constructor or DestructorSupportedNot Supported
Database ConnectivityNot SupportedNot SupportedSupported



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!





14 comments:

About | Contact | Disclaimer-Privacy Statement
©2013-2014 isearchfun.in All Rights Reserved.
Friends : bindassnet.in- An Internet Blog
Protected by Copyscape DMCA Takedown Notice Violation Search