|
|
|
|
|
by bitemix
4369 days ago
|
|
1) The containing folder you're referring to is not part of the compiled artifact. 2) If you're feeling particularly adventurous, you could probably write a ClassLoader which knows how to resolve the full class identifier (including package) to its actual class, which needn't be in that directory structure, but at that point you're fighting 19 years of Java history. 3) Scala mitigates the crazy folder hierarchies by letting you structure the source more naturally (needn't be a 1:1 between package and folder structure, and even have multiple classes per file), and ensures the resulting class files are structured the way the JVM's default ClassLoader wants them. That said, many folks end up adopting the Java source style for consistency, especially in teams where they have to maintain legacy Java code anyhow. |
|