I\'ve seen some code such as:
out.println(\"print something\");
I tried import java.lang.System;
but it\'s not working
out is a PrintStream type of static variable(object) of System class and println() is function of the PrintStream class.
class PrintStream
{
public void println(){} //member function
...
}
class System
{
public static final PrintStream out; //data member
...
}
That is why the static variable(object) out is accessed with the class name System which further invokes the method println() of it's type PrintStream (which is a class).