No, packages are generally accepted. Although it is often useful to think of them hierarchically, there is no concept in Java or compilation that says java.awt.event belongs to java.awt .
Your comparison with SQL tables is not entirely correct, because in SQL databases there is no such thing as a subtable. Instead, imagine that you have a table representing all your classes, with the following data:
ID | Package | Name -------------------------- 1 | awt | SomeClassName1 2 | awt.event | SomeClassName2
Now, if you want to get awt classes, you would say:
SELECT * FROM MyTable WHERE Package = 'awt'
You did not expect this to give you both entries, just because the package name starts with awt , could you?
Stripling warrior
source share