Pages

Comparing 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.


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 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


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