Professional Documents
Culture Documents
println();
----------------------------------------
Let us understand the sample example and relate to the above concept.....
Class Demo
{
private static String out = "java";
public static void main(String args[]) {
s.o.p(Demo.out.length());
}
}
--> Here in the above code Demo is class and "out" is a reference of String typ
e and length() is a function in String class.So we get the output of the above
program as 4.
Here we relate the above example with System.out.println();
class System
{
static PrintStream out;
public static void main(String args[]) {
s.o.p("console");
}
}
--> Here System is class available in java.lang package and "out" is a referen
ce variable of type PrintStream and println() is a method of PrintStream class.