how system.out.println() works?

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


Please Help Members By Posting Answers For Below Questions

What is 16 bits called?

495


Is main an identifier?

546


Explain an algorithm to find depth of a binary tree.

544


Is java util list serializable?

533


What is dot operator?

572






Define iterator and methods in iterator?

545


What is unsigned char?

612


what are abstract functions?

557


What is method overloading with type promotion?

577


What are the practical benefits, if any, of importing a specific class rather than an entire package (e.g. Import java.net.* Versus import java.net.socket)?

588


What are the restrictions imposed on method overriding?

550


What is linked hashmap and its features?

538


What is proper subset?

535


Name four container classes.

552


What is scope of a variable?

603