Java version of Scanner_Class.h