Both serve the different purpose its like asking which is more important apple or oranges.
C++ and Java both are object-oriented languages but two languages are worlds apart. Java is an interpreted language—”write once, run anywhere”—while C++ is a compiled language.
C++ is an object-oriented language which evolved from C and more close to machine, so if you want to create 'infrastructure software' such as OS, DBMS, compiler, linker, interpreter then C++ is more suitable. But if you want develop software which runs anywhere without compilation, you can choose java (JVM takes care it). Java is the foundation program for Android applications, so it’s the general choice for mobile developers.