Holding the caveat in mind that no programming language is really “better” than any other in any final or universal sense, here’s what we can say about how these languages compare to one another and their respective pros and cons.
Both Java and C++ are compiled languages that turn your source code into bytecode for your computer to execute. Both languages also have large numbers of object-oriented features without either being a pure object-oriented language. While C++ incorporates other paradigms, Java makes use of certain primitive data types that do not have to be declared as part of any class.
One big difference, however, is that Java bytecode is platform-independent and can be used on any operating system, whereas C++ code has to be compiled differently for each operating system. This is because the former language is interpreted in addition to being compiled, while the latter is only compiled. Java libraries also tend to have classes with many more higher-level functionalities. Furthermore, Java tends to be much more optimized for things like mobile apps and desktop GUI development, whereas C++ is more traditionally used for gaming, computer graphics, and all manner of large, complex programs in general.