Friday, 22 June 2018

The major differences between C++ and Java.

Major differences between C++ and Java.

                                                           Java


Major differences between C++ and Java: 1.Java was developed by James Gosling and his team. Development began in 1991.

2. Java does not support pointers, unions, operator overloading and structure.

3. Java supports garbage collection.

4. Java is platform independent.

5. Java supports inheritance except for multiple inheritances.

6. Java is interpreted.

7. Java does not support destructor

8. Java is both compiled and interpreted.

9. Java does not support conditional compilation. 

10. Java programs are platform independent. Java programs are written for Java Virtual Machine (JVM) and wherever a JVM is installed, Java program will run without needing recompilation.

11. Java does not support operator overloading. However, function overloading is possible.

12. Java supports only call by value.

13. In Java programs, you can write comments using  /** … */

14. Java supports the unsigned right shift >>> operator.

15. Java does not support goto statement (although goto is a reserved keyword in Java)


Major differences between C++ and Java

Java language was created by James Gosling to be a general-purpose, concurrent, class-based, object-oriented programming language. Java inherits its syntax from C language and building from C++ language. 

The greatest difference between Java and C++ is how a program runs in these languages. While C++ program runs as executable native equipment code; a Java program runs in a Java Virtual Machine (JVM). This clever idea of creating and using a virtual machine to run Java programs revolutionized the computer programming. 



           
                                          

                                                       C++


1. C++ was developed by Bjarne Stroustrup. Development began in 1979. 



2. C++ is a compiled language.

3. C++ supports conditional compilation and inclusion. 

4. C++ programs are platform dependent. They need to be compiled for a particular platform. 

5. C++ does support operator overloading. Function overloading is also available. 

6. C++ fully support pointers. 

7. C++ supports structures. 

8. C++ supports unions. 

9. C++ does not have built-in support for threads. 

10. C++ supports multiple inheritances. 

11. C++ provides support both for call by value and call by reference. 

12. C++ does not support comments within source code.

13. C++ has no support for the unsigned right shift operator ( >>> ). 

14. C++ supports destructors.

15. C++ provides a virtual keyword to support function overriding.

C programming language makes the heart of modern complex computer systems. C++ came as a major boost to the capabilities of C language. Although the syntax and core were same, there was a considerable difference between C and C++. Later came Java programming language — which further enhanced the limits of what a programmer could easily do. Java has significant similarities and differences with C++. In this article, we will discuss major differences between Java and C++ programming languages.


No comments:

Post a Comment