Every programming language has its own set of advantages and disadvantages that you have to consider when you start working on a project. Python is a very popular programming language because the syntax is easy to understand and it can be a great language to quickly start working on an idea and instantly see results. I think Python also works extremely well for smaller programs and apps that use some form of machine learning because of all the unique libraries like TensorFlow and Pytorch. Java on the other hand is better suited for more large-scale projects that need to be capable of scaling to thousands of lines of code without becoming an unreadable mess. One considerable advantage of Java is its slogan “write once, run anywhere”, meaning that you can develop a Java program on your own computer and not worry about it running on a different computer. Using C++, you might have to compile separate versions of your program to make sure it’s compatible and works on Windows, Mac and Linux which could be time-consuming. A significant disadvantage of Java is that sometimes the language can be overly verbose compared to other languages like Python which feels much closer to writing out ideas as pseudocode.
Overall C++ is considerably faster and delivers better performance compared to Java if you require a program to make use of lower level hardware and memory. For instance, most popular game engines are written in C++ like Unreal Engine and Cry Engine. Developers use C++ for these game engines because they need to squeeze out every last bit of performance for a game to run fast enough to be playable. There are many reasons you might want to integrate multiple languages together like C++ and Java. For example, let’s say you are designing a Java program but aren’t really satisfied with how slow it takes for your program to load and open. You could then use C++ to optimize the parts of code that deal with loading and opening while keeping the user interface Java code. Security wise, I think Java would generally be safer on larger applications where you have multiple teams of people working together on separate parts of code like many large companies do and you also don’t have to worry as much about memory management. Security problems like memory leaks might be more common and harder to find with C++ compared to Java.