Chapter 10, java interaction