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

What is method with example?

786


What is the null?

775


When a thread is executing synchronized methods , then is it possible to execute other synchronized methods simultaneously by other threads?

792


Why is stringbuffer not immutable?

774


What does string intern() method do?

828


Can Exception handling we can handle multiple catch blocks?

831


Explain the use of volatile field modifier?

853


What does those terms actually mean included in the j.d.k i.6?

1811


How many threads does a core java have?

777


What is a website container?

693


Explain about java sdk?

806


Can we instantiate interface in java?

899


Tell us something about different types of casting?

708


What is not object oriented programming?

695


What is java beans?

768