Java Basic homeworks