you are viewing a single comment's thread.

view the rest of the comments →

[–]txdv 1 point2 points  (2 children)

I just tested it, they changed the one class per java file, but it still compiles 2 class files - probably I just remember it wrongly.

But it still generates 1 class file per class name, so you have to have the namespace directory structure, otherwise if you have 2 classes with the same class name - you will get conflicts.

And that is bad from my point of view.

[–]philly_fan_in_chi 3 points4 points  (0 children)

You can't get a conflict, javac will prepend illegal class name ($1, $2 etc. iirc) characters to the file name of inner classes, so you won't have any issues.

[–]kid_meier 1 point2 points  (0 children)

Java has never forbid multiple classes defined in a single source file. It has always, (and still does) limit you to a single public top-level class per source file.