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
What is parameters example?
What is meant by local variable and instance variable?
Is null keyword in java?
How we can run a jar file through command prompt in java?
How to instantiate static nested classes in java?
Can you use this() and super() both in a constructor?
What is the difference between Array and Hash Table?
What is the significance of continue jump statement? Explain with an example.
Why does my function print none?
Can we print null in java?
What are the main uses of this keyword?
Will set allow duplicates in java?
What access modifiers can be used for class ?
What is fail fast in java?
I want to print “hello” even before main is executed. How will you acheive that?