how system.out.println() works?
Answers were Sorted based on User's Feedback
Answer / 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 |
Answer / manish
In system.out.println()
'System' is a class which is having reference variable 'out' of type printStream class, and PrintStream class having overlaodded methed 'println()' for different purposes..
| Is This Answer Correct ? | 7 Yes | 0 No |
What is the significance of java packages?
What is string syntax?
In method overloading ,if i change the return type to Long instead of INT,is the program execute
What is a variable declaration?
What is the purpose of using break in each case of switch statement?
What is the difference between array and array list in java?
How does thread synchronization occurs inside a monitor?
What isan abstract class and when do you use it?
What is java util concurrentmodificationexception?
What do you mean by a JVM?
What are different types of access modifiers?
what is a green thread? : Java thread