Interviewer And Interviewee Guide

Java Classes Interview Question:

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

Submitted by: Administrator
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 ultimately, we can call println() method of static out reference of System class.
Syste.out.println();
Submitted by: Administrator

Read Online Java Classes Job Interview Questions And Answers
Copyright 2007-2024 by Interview Questions Answers .ORG All Rights Reserved.
https://InterviewQuestionsAnswers.ORG.