A2Z UPDATES: Major(Top) Difference Comparisons Similarities between Java and C++

Thursday, 13 June 2013

Major(Top) Difference Comparisons Similarities between Java and C++

In this post intends to provide major(top) difference between java and c++,here we keep some search keywords like:differences of java,c++,major difference between c++ and java,Difference between c++ and java,Similarities and Differences between c++ and java,Comparison between java and c++ and c++ and java major differences.

Major Differences Similarities Comparison between Java and C++:

Here majorly concentrate on what are major differences between java and c++,what similarities between java and c++ and comparisons between java and c++.Differences of java and c++ explain with table its easily understand everybody and easily remember so we keep these major differences between java and c++ with table,difference of java and c++.

major difference between java and c++

-->

         Features
       Java
        C/C++
Pointer
No
Yes
Operator Overload
No
Yes
TypeDef,Define,Preprocessors
No
Yes
Structures,Unions
No
Yes
Enums
No
Yes
Functions
No
Yes
Goto Statament
No
Yes
Automatic  Coercions
No
Yes
Global Varibales
No
Yes
Templates
No
Yes
Private,Protected,Public Inheritance
No
Yes
Default Parameters
No
Yes
Garbage Collections
Yes
No
Multi Thread Support
Yes
No
Multiple Inheritance
Yes(Supports only interface inheritance and not implementation inheritance)
No
Exception Handling
Yes(Try/Catch must be defined if the function declare that it may throw an Exception)
Yes(You may not include the Try/Catch even if the function throws an Exception)
Function Overload
Yes
Yes
Internationalization
Yes
Yes
Include of other Objects
#import
#include


Difference between C++ and Java:

1.    C++ supports pointers whereas Java does not pointers. But when many programmers questioned how you can work without pointers, the promoters began saying "Restricted pointers.” So we can say Java supports restricted pointers.
2.    At compilation time Java Source code converts into byte code .The interpreter execute this byte code at run time and gives output .
    Java is interpreted for the most part and hence platform independent. C++ run and compile using compiler which converts source code into machine level languages so C++ is plate from dependents
3.    Java is platform independent language but C++ is depends upon operating system machine etc. 

   C++ source can be platform independent (and can work on a lot more, especially embedded, platforms), although the generated objects are generally platform dependent but there is clang for ,which doesn't have this restriction.

4.    Java uses compiler and interpreter both and in C++ there is only compiler
5.    C++ supports operator overloading multiple inheritance but Java does not.
6.    C++ is more nearer to hardware then Java
7.    Everything (except fundamental types) is an object in Java 

(Single root hierarchy as everything gets derived from 

Java.lang.object).

8.    Java does is a similar to C++ but not have all the complicated 

aspects of C++ (ex: Pointers, templates, unions, operator 

overloading, structures etc..) Java does not support conditional 

compile (#ifdef/#ifndef type).

9.    Thread support is built-in Java but not in C++. C++11, the most recent iteration of the C++ programming language does have Thread support though.
10. Internet support is built-in Java but not in C++. However C++ has support for socket programming which can be used.
11. Java does not support header file, include library files just like C++ .Java use import to include different Classes and methods.
12. Java does not support default arguments like C++.
13. There is no scope resolution operator :: in Java. It has . Using which we can qualify classes with the namespace they came from.

14. There is no Goto statement in Java.

15. Exception and Auto Garbage Collector handling in Java is different because there are no destructors into Java.
16. Java has method overloading, but no operator overloading just like C++.
17. The String class does use the + and += operators to concatenate strings and String expressions use automatic type conversion,
18.Java is pass by value

19. Java does not support unsigned integer.

                       

   more differences coming soon............ 

1 comment :

  1. Thanks a lot for this wonderful and admiring information. I hope that you continue to provide us. Aditya Institute of Technology and Management is one of the reputed educational institutions in Andhra Pradesh. It is located near Tekkali in a beautiful and peaceful environment that occupies 50 acres of land. It has been running successfully for years under the esteemed leadership of Dr. K Someswara Rao Garu. The colloquially called AITAM is famous for its quality of education, infrastructure, and discipline on the campus.
    Please Visit: ADITYA INSTITUTE OF TECHNOLOGY AND MANAGEMENT (AITAM).

    ReplyDelete