Paul Clapham wrote:If you use the name of a type in an abbreviated fashion (i.e. without the package part of the name) then you have to import that name. In your first example you used the name (ServletConfig) without specifying the package, so you need an import.
In all of your other examples you didn't use the names of any types, so that rule doesn't apply. In particular your imaginary rule about having to import methods is just that -- imaginary.
Bear Bibeault wrote:Basic java: if you don't have a reference to the class, you don't need an import.