Hacker News new | ask | show | jobs
by kitd 1353 days ago
I have long considered that having to have the class definition explicit in the file is redundant, especially as the 2 have to have the same name anyway. Obviously if you need to `extend` or `implement` then an explicit declaration is needed. But otherwise, just defaulting to the file base name is more than sufficient.
2 comments

Except for interfaces, record classes, type parameters, class-level annotations and javadoc. There's probably more I'm not thinking of right now.
Groovy does a good job with this type of thing.

Edit: but a bad job at a lot of other things.