thinking in java chapter 10