0
Both Java and C++ are general-purpose languages, however, the inner workings and compilation processes are very different. Both are object-oriented programming languages, however, Java is purely object-oriented, meaning that every function and variable belong to a class, while C++ is object-oriented AND functional, so there can be functions floating around in the global scope. Another thing is memory management. Java has a garbage collector, which automatically gets rid of objects automatically, while C++ doesn't, but gives you the tools to do so, such as malloc and free, however, manual memory management can lead to memory leaks which are very detrimental to performance. The last thing that sets both apart from one-another is the compilation process. In C++, source file compilation goes like this preprocessor>compiler>assembler>linker, while Java is a bit more different. Java source files are sent through a compiler, which compiles the code into byte code which is then run off of the Java Virtual Machine (JVM).
In short, both languages are useful in their own ways respectively, and it all really boils down to what you're trying to achieve with programming, and which one you prefer.
Hope this helped!



