I don't have a problem with code I'm working on, I just want to ask a question about something regarding creating classes. In some cases, like this project, we create classes in separate .java files (apple.java, snake.java, etc). But some of the other tasks we have done previously have us create multiple classes in the same file (for example, several tasks related to working with Dog and Cat objects which were both in the same file). I was just wondering if someone could clarify when the classes go in separate files and when they go in the same file? Would this project work if GameObject, Snake, and Apple were all defined within SnakeGame instead of separate files?
Just want to ask clarification on where classes are declared