C++ is platform-dependent and based on Write Once Compile Anywhere, whereas Java is platform-independent and based on Write Once Run Anywhere.
Programs written in C++ can only be compiled; Java programs can be compiled and interpreted.
Memory management in C++ is controlled by the programmer, whereas memory management in Java is controlled by the operating system.
Java has richer libraries with code reusability and allows calls through Java Native Interface and Java Native Access, whereas C++ has few libraries with low-level functionalities.
C++ supports operator overloading, Goto statements, structures, pointers, etc., whereas Java supports threads, comments in documentation, unsigned right shift operators, and so on.