how system.out.println() works?

Answers were Sorted based on User's Feedback



how system.out.println() works?..

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

how system.out.println() works?..

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

Post New Answer

More Core Java Interview Questions

what is bmg file and how to create that files?what will it contailn?

0 Answers   HCL, Probe Services,


Tell me the difference between an applet and a Japplet?

1 Answers  


How to send a request to garbage collector?

4 Answers  


What is meant by singleton class?

0 Answers  


How does singleton class work?

0 Answers  






how can i use a nonsynchronized hashtable?

0 Answers   CoreObjects,


What's the purpose of using break in each case of switch statement?

0 Answers  


can u handle an error if u write Thowable in the catch class lise try { some errorneous code }catch(Throwable e){ ...}

4 Answers  


What is collection class in java? List down its methods and interfaces.

0 Answers  


When try and catch block is used ?

6 Answers  


What is collections framework?

0 Answers  


What is a literal coding?

0 Answers  


Categories