My excercise code of Java book