Why only 1 public class in Java file

It forces all Java code to be organized in a certain way, which in the long run helps improve code readability.

The Java designers chose a strict approach that enforces their idea of good design practices, and this is part of that theme. Contrast that with the anything-goes attitude in Perl.

Leave a Comment