Comparison Index C++ Java
Platform Independent C++ is platform dependent Java is platform independent
Mainly used for C++ is mainly used for system Java is mainly used for
programming application programming. It is
widely used in window, web
based, enterprise and mobile
applications.
Goto C++ Supports goto statement Java doesn’t support goto
statement.
Multiple inheritance C++ supports multiple Java doesn’t support multiple
inheritance inheritances through class. It
can be achieved by interfaces
in java.
Operator Overloading C++ Supports operator Java doesn’t Supports operator
Overloading Overloading
Pointers C++ Supports Pointers. You can Java Supports pointer
write pointer program in C++ internally. But you can’t write
the pointer program in java.
Compiler & Interpreter C++ uses compiler only Java uses both Compiler &
Interpreter.
Call by value & Call by C++ Supports both call by value Java supports call by value
reference & call by reference only. There is no call by
reference in java.
Structure & Union C++ Supports Structures & Java doesn’t support structures
Union & union.
Thread Support C++ doesn’t have built-in Java has built-in thread
support for threads support.
Virtual Keyword C++ Supports virtual keyword Java has no virtual keyword.
so that we can decide whether We can override all non static
or not override a function. method by default. In other
words, non static methods are
virtual by default.