Michael:
Thanks for your question. It raises an interesting point. A full discussion of these issues would involve a very long discussion -- longer than is possible here. However, I will offer a few thoughts.
First, your question about runtime performance: As things currently stand, given two identical programs, one Java, one C++, the C++ program will typically run quicker because C++ is typically compiled to native code that the CPU executes directly. Java code is compiled to an intermediate code (called bytecode) which is executed under the control of the Java Virtual Machine (JVM). Thus, the typical Java environment incurs an overhead that is not present with C++.
In the preceding paragraph, I repeatedly use the
word "typically' because I am sure that exceptions can be found. Furthermore, it is now possible to write "managed C++", which executes in a managed environment in much the same way as Java does.
One other point: Because of advances to the JVM over the years, (such as on-the-fly compilation), the runtime differences between Java and C++ are less pronounced today than they were years ago. Frankly, I think that Java is a good choice for many, many different types of programs. In fact, this is one of the main themes in my book
The Art of Java. Java is a powerful, full-featured language that is up to nearly any task!
In general, when thinking about Java and C++ it is important to remember that both were invented to solve different sets of problems. In the case of C++ (which grew out of C), it was to facilitate the creation of high-performance, system-level software. For Java, it was to enable the creation of cross-platorm, portable, safe, and secure code. Thus, both languages have their uses, and their strong points. Fortunately, because of their similarities, most programmers eventually become fluent in both.
To a larger point: Today, the world of professional programming revolves around a core syntax that is shared by C/C++/Java/C#. This is the mainstream. Its where the action is. Its where the next advance in programming will flow from.
Its really an exciting time to be a programmer!