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
Which api is provided by java for operations on set of objects?
What is the hashcode () and equals () used for?
How to call one constructor from the other constructor ?
What is nan in java?
What is a "pure virtual" member function?
What is a jagged array in java?
What are passing parameters?
Can we write any code after throw statement?
Explain the purpose of garbage collection in Java?
Is logger a singleton?
What is sleep method?
What does java stand for?
Is it necessary that each try block must be followed by a catch block?
How to display all the prime numbers between 1 and n (n is the number, get the input from user)
Can we sort hashmap in java?