Comparison between Java and C++

No Java C++

1

Java is true Object oriented language.

C++ is basically C with Object-oriented extension.

2

Java does not support operator overloading.

It supports goto statement.

3

It supports labels with loops and statement blocks.

C++ supports operator overloading.

4

Java does not have template classes as in C++.

C++ has template classes.

5

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.

6

Java does not support multiple inheritance of classes but it supports interface.

C++ supports multiple inheritance of classes.

7

Runs in a protected virtual machine.

Exposes low-level system facilities.

8

Java does not support global variable. Every variable should declare in class.

C++ support global variable.

9

Java does not use pointer.

C++ uses pointer.

10

It Strictly enforces an object oriented programming paradigm.

It Allows both procedural programming and object oriented programming.

11

There are no header files in Java.

We have to use header file in C++.

Previous Post Next Post

Contact Form