Difference between C++ and Java

In this article, we are going to discuss the difference between C++ and Java.

You can also refer our video tutorial for same.

So let’s start with this tutorial :

Difference between C++ and Java :

There are many differences between C++ and Java. Some of the differences are given below :

SR. No.AttributeC++Java
1.Programming ParadigmC++ is a multi-programming paradigm as it supports procedural programming and object-oriented programming paradigm.Java supports object oriented programming paradigm.
2.PrincipleC++ works on WOCA (write once compile anywhere).Java works on WORA (write once run anywhere).
3.Platform DependencyC++ is a platform dependent language.Java is a platform Independent language.
4.Translation IssueC++ is directly compiled into machine code, so we can say that c++ is a compiled language.Java uses compiler and interpreter. Java source code is compiled into byte code at compilation time. The interpreter executes the byte code at runtime and produces output. 
5.PortabilityC++ is not a portabel language.Java is a portable language. We can carry java byte code on any platform.
6.SecureC++ is not so much secure programming language as C++ program directly contact with OS.Java is a secured programming language as java program run inside the JVM.
7.PointersC++ supports pointer. we can pointer program in C++.Java supports pointer internally but We cannot write pointer program in java.
8.Structure and UnionC++ supports structure and union.Java does not support structure and union.
9.Multi-ThreadingC++ does not have built-in support for thread.Java has built-in thread support.
10.Function-callingC++ supports both call b y value and call by reference.Java supports call by value only.
11.Memory ManagementC++ manages the memory via constructors and destructors. Java does not support destructor, in place of destructor java use automatic garbage collection.
12.ExtensionC++ files are saved by the extension “.cpp”.Java files are saved by the extension “.java”.
13.Multiple-InheritanceC++ supports Multiple-Inheritance.Java does not support Multiple-Inheritance.

If you found this post useful, don’t forget to share this with your friends, and if you have any query feel free to comment it in the comment section.

Thank you 🙂 Keep Learning !

Leave a Comment

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