Sunday, September 18, 2022

Difference between Java and C++ | Java Vs C++

Java and C++ are two of the most widely used languages in the software world. There are many similarities between these 2 languages, but they also have a few differences. Let's look at the difference between Java and C++.



Java

  • Java is platform-independent. It is based on the concept of Write Once Run Anywhere.
  • Java is also an object-oriented language
  • Java uses both compiler and interpreter.
  • Java is mainly used for application programming.
  • Java has built-in thread support.
  • Java doesn't support multiple inheritance through class. It can be achieved by using interfaces in Java
  • Java supports call-by-value.
  • Java does not support features like operator overloading, Goto statements, structures, pointers, unions, etc.
  • Java has no virtual keyword. We can override all non-static methods by default
  • Java supports unsigned right shift >>> operator
  • Java supports documentation comments. (/** ... */)

C++

  • C++ is platform dependent. It is based on the concept of Write Once Compile Anywhere.
  • C++ is both procedural as well as an object-oriented language
  • C++ uses only compiler.
  • C++ is mainly used for system programming.
  • C++ doesn't have built-in support for threads.
  • C++ supports multiple inheritance.
  • C++ supports both call-by-value and call-by-reference.
  • C++ supports features like operator overloading, Goto statements, structures, pointers, unions, etc.
  • C++ supports virtual keyword used to decide whether or not to override a function.
  • C++ doesn't support >>> operator.
  • C++ doesn't support documentation comments.

No comments:

Post a Comment