yseJ
Empire strikes back
mainly, if you care about performance and robustness, ie any real-time engine or system, a limited resource embedded system, or a server being flooded with requests, java will always be inferior to c++ because of automatic memory management and garbage collector.Why?
automatic memory management usually means there is non-deterministic time of destruction of heap objects (pretty much all java objects). so programmer has no fine control over that. program simply cannot ever assume that at some point unneeded object will be disposed of.
think about it this way, its automatic transmission vs a manual one. if your goal is to get from place a to place b over smooth road and not worry about time, auto will do the trick.
if the goal is to get as fast as possible on a tricky road, manual will by far be best your bet, given you have a very good driver who knows what hes doing. with java you delegate too much control to jvm and garbage collector and pray. and in practice when youre in bad conditions, it just cant perform as well. theres a reason why backends and OSs are built on c or c++
the tradeoff I guess is that if you have a mediocre or average driver (programmer) doing memory management in c/c++, its likely a recipe for a disaster.
there also are also problems with their native threading libraries (although I think relatively recently java addressed some of them), and even their RAII was just introduced recently (java 7 I believe), and that goes back to the destruction of objects.