Something that\'s confused me - an example:
Thing.java:
import java.util.Date;
class Thing {
static Date getDate() {return new Date();}
}
import statements are used for couple of things.
Whenever we say
System.out.println( new Thing().getDate().getTime() )
The compiler parses this statement left to right and gets into that class.
First level compiler parsing.
As a consumer TestUsesThing gets only long variable.
System.out.println( new Thing().getDate() )
5.1 In this case we are implicitly accessing .toString() method