Guajara in other languages: Spanish, Deutsch, French, Italian ...



Comparison of Java to C Plus Plus

This is a comparison of the Java programming language to the C++ programming language.

Table of contents
1 Advantages of Java
2 Disadvantages of Java
3 Advantages of C++
4 Disadvantages of C++
5 Differences between the languages
6 External References:

Advantages of Java

Disadvantages of Java

  • Access to native operating system and hardware functions requires a non-Java access library be coded to the JNI (Java Native Interface) API specification. Java programs cannot directly access such services.
  • No compile-time "template" generic containers. (this is slated for inclusion in version 1.5 due to popular demand.)

Advantages of C++

Disadvantages of C++

Differences between the languages

  • C++ has operator overloading. This was not included in Java in order to keep code more readable. While there can be little doubt that this feature is often misused in C++, decreasing readability, there are also numerous good uses, such as in mathematical and scientific programming, where its use improves readability. Because the biggest application area for the Java programming language is business software, operator overloading is still considered by the language designers to be unnecessary, though many hold this position in contention.
  • All objects in Java are pass-by-reference, and are dynamically allocated.
  • Java has no global constants, variables, or functions.
  • C++ has flexible support for pointer manipulation, while Java only allows one to assign object references.
  • There is no "goto" in Java (though it is a reserved keyword and barred from use.)
  • C++ supports multiple inheritance while Java uses "interfaces". They each have their advantages and disadvantages. Multiple inheritance is often more logical and representative of how one conceptualizes a problem. However it also complicates member overloading and inheritance, and even its proponents only recommend its use sparingly. Java interfaces significantly simplify its single inheritance model syntax, but can result in larger and less intuitive source code.
    • Some degree of multiple inheritance functionality can also be gained by using "inner classes"

External References:





Wikipedia - All text is available under the terms of the GNU Free Documentation License.

Tagoror dot com  -  Legal Information  -  Contact us