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 |
Can we override singleton class?
Is boolean a wrapper class in java?
Package1 and Package2 both have a method name lets say "methodA" with different implementation. When I import both the packages in a java class how can I use both the methods?
What is string in java? String is a data type?
What are the differences between throw and throws?
What is difference between jdk,jre and jvm?
Which oo concept is achieved by using overloading and overriding?
Is array serializable java?
Is heap stored in ram?
String is mutable or immutable?
Which programming language is best in future?
What is a pointer and does java support pointers?