Added some Java and C++ code.