Lowest price ever! Learn Generative AI for 48% less!
Get my discount+ 9
Java public class
Why there is only one public class per Java file? Any help would be appreciated.
2 Answers
+ 9
there can be anonymous inner classes, but conventionally we use 1 because its easier to maintain and reuse
+ 1
We have to make the java file name as the name of the file.Since each java file has unique name,hence our java file has only single public class.
THIS IS MY LOGIC...THERE MAY BE ANY OTHER REASONS FOR THIS😀