Liang Java Exercise 8.7