Is it possible to have several classes in a single java file in Eclipse? Or must I really have each one in a different file?
Is it just something imposed by Eclipse, or does the Java compiler have something against having everything in the same file?
You can only have one public class per file, according to the Java spec (this is not Eclipse's rule). You can have inner classes, or static classes, in the same file as a public class.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With