In System.out.println() explain it.My doubt, we call static method with Class name but here what is "out"?

Showing Answers 1 - 4 of 4 Answers

Sanjib Mondal

  • Dec 2nd, 2006
 

Actually System is class define in java.lang package...

class System{                                                            //Member variables...                                                                     static PrintStream out;                                       

.................................

 //Member methods...

.................                                                                                           

}                                                                                                       so out is a static reference of PrintStream class,which is define in java.io package and println() is a method of PrintStream class...                           So altimately, we can call println() method of static out reference of System class.                  Syste.out.println();

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions