Sergej Smoljanov wrote:What meaning of exemple? Because the package java.awt has a subpackage image, it cannot (and does not) contain a declaration of a class or interface type named image.
That means you can't give a class/interface the same name as one the subpackages of the package the class/interface is in (just like you can't have a class and interface with exactly the same name in the same package). Normally this could/should never happen, unless you deliberately violate the naming conventions (packages should be all lower case, class/interface names should be CamelCase). If you try to do so, you'll get a compiler error. And that makes sense!
A little code snippet to illustrate:
Now I can create without any problem a package
com.oracle.image (so no compiler error, only a warning on class
image in package
com.oracle: "
The type image collides with a package").
But then I (try to) create the following class:
Now I get a compiler error ("
The package com.oracle.image collides with a type"), because the package name is exactly the same as class
image in package
com.oracle.
Hope it helps!