* Jon Harrop:
1. Execute code at compile time thanks to C++'s Turing-complete type system.
2. Low-level access to data structure internals, so you have more control
over memory usage.
3. Write unsafe code that accesses raw memory locations.
4. Operator overloading.
Both C++ and Java lack lots of features found in other languages, of course.
Of course Java can do a lot of things that C++ can't in a reasonable way
(but one example, safe applets), but to the above list I'd add as most
important,
0. C++ can interface to (or be used to implement!) OS or other
API functions, and in general, assembler language.
For example, the virtual platform that Java code runs on is implemented
in C and/or C++; Java's platform /independence/ is directly implemented
in terms of C and C++ platform /availability/.
C++ is a combination of systems-programming language, application/system
glue language, and application language. Java is a pure application
language. In pure Java you're restricted to the virtual Java universe
(not that that's bad, it's useful e.g. for productivity, but it's a
restriction), while in C++ you're in a mostly infinite universe,
although one with certain barred areas (such as applets, unless you're
willing to use a technology like Microsoft's ActiveX controls).