First, regardless of what your book says, it is better Java programming style to define each class in its own file --
especially when first learning.
After you move each class to its own file, make sure that you've defined all the variables you'll need to use within that file. If you still have problems, post the code from both files and the error message(s).