Answer Posted / surya simhadri
System is a predefined class in lang package and out is a
static member with in a System class and also out is an
instance of PrintStream which is a static inner class of
System class and finally print() and println() are member
functions of PrintStream class. So we can call those
methods using out and out is called with class name in
which it is declared( bcoz it is static member variable of
system class). So finally we can call println as
System.out.println().
EX:
class System {
static public PrintStream out;
public static class PrintStream {
public string print(String s) {
}
public string println(String s) {
}
public static void main(String[] arg) {
System.out=new PrintStream();
System.out.println("");
}
}
}
| Is This Answer Correct ? | 20 Yes | 1 No |
Post New Answer View All Answers
What are the rules for variable declaration?
Can a method be overloaded based on different return type but same argument type?
Can we make constructors static?
What is the meaning of I ++ in java?
How does system arraycopy work in java?
Does the order of public and static declaration matter in main method?
How are this() and super() used with constructors in java programming?
How is Object Oriented Programming different from Procedure Oriented Programming?
why java uses class level type casting ?
How to declare objects of a class ?
Can a static member function access member variable of an object?
Why hashcode is used in java?
What is a void method?
How do you detect memory leaks?
What is the disadvantage of java?