Switch from C++ to Java