My example code of Java book