I want u to remember one thing(V imp).
java.lang package is loaded by default.
Which means that methods under this package can be accesses without
defining the package.
eg - System.out.println("");
what does this mean - System(a class) is in java.lang
(java.lang.System)
This class has a "field" (not a class) "out" which is of the type
PrintStream. So out inherits the methods of PrintStream. PrintStream
has a method println().
This is how System.out.println() works.
In ur program u have used out.println();
how will the compiler know which package to check the "out function
for"
Actually out is in the package java.lang.System.
is it clear.
Check java API for more details
http://java.sun.com/j2se/1.4.2/docs/api/index.html