explain System.out.println()

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


Please Help Members By Posting Answers For Below Questions

Write a method to check if input string is palindrome?

580


What one should take care of, while serializing the object?

483


Explain what access modifiers can be used for methods?

567


What are the steps involved to create a bean?

680


Is node a data type in java?

496






What is visibility mode?

529


What are the advantages of compiled language?

575


What are the two basic ways in which classes that can be run as threads may be defined?

550


Explain tree set and its features?

599


What is comparable and comparator interface? List their differences

581


Is java type safe?

511


What is the difference between replace and replace all?

473


What is the difference between sop and work instruction?

481


Explain about version control?

592


Why are arrays useful in java?

540