Java VS C++

Java C++
Java is Object-oriented language. C++ is basically C with Object oriented extension.
Java does not support operator overloading technique. C++ supports operator overloading technique.
It supports labels with loops and statement blocks It supports goto statement.
Java does not have template classes as in C++ C++ has template classes
Java compiled into byte code for the Java Virtual Machine. The source code is independent on operating system. Source code can be written to be platform independent and written to take advantage of platform. C++ typically compiled into machine code.
Java does not support multiple inheritance but it supports interface C++ supports multiple inheritance of classes.
Java does not support global variable. Every variable should declare in class. C++ support global variable
Java does not use pointer. C++ uses pointer.
It Strictly enforces an object oriented programming structure. It Allows both procedural programming and object-oriented programming
There are no header files in Java. We have to use header file in C++.
In java, all method definitions are defined in the body of the class. In C++ it would look like all the functions are inline, but they’re not.
Java does not support scope resolution operator :: C++ support to scope resolution operator ::
Java does not support destructor. C++ support to destructor.

Leave a Reply

Your email address will not be published. Required fields are marked *