you can have unlimited classes in one file, but you can only have one public class in one file, and this class needs to have the same name as the Java file.
But the book I'm learning from has more than one public classes. I have attached the two pages I want to show you. It is a little difficult to read, but open it up (Right click --> Open with --> Paint) with Paint. Thank you.