Answer Posted / subbu
//the System class belongs to java.lang package
class System {
public static final PrintStream out;
//...
}
//the Prinstream class belongs to java.io package
class PrintStream{
public void println();
//...
}
java.lang package is default package hence no need to import
additionaly to use System class
System is having static reference of PrintStream class whihc
has println() method.
So we can directly acces the println() using out referece.
System.out.println();
| Is This Answer Correct ? | 16 Yes | 0 No |
Post New Answer View All Answers
State some situations where exceptions may arise in java?
If an application has multiple classes in it, is it okay to have a main method in more than one class?
What is hashmap in java?
Can you call a method in a method?
Is it correct to say that due to garbage collection feature in java, a java program never goes out of memory?
Explain the difference between static and dynamic binding in java?
Write a program to reverse array in place?
What is hashmap and map?
Why is it important to initialize a variable?
How can we make sure main() is the last thread to finish in java program?
What is the effect of keeping a constructor private?
What is console based application in java?
Is it necessary that each try block must be followed by a catch block?
Will minecraft java be discontinued?
What is lastindexof in java?