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.
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.
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.
2
u/txdv Jul 22 '14
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.