add the sample codes in Core Java Volumn I Chapter 6