Java Training Code