explain System.out.println

Answer Posted / lakshmi

System.out.prinltn

System
--------
> pre-defined class in java.lang package
out
--------
out- it is a static variable inside System class of type PrintStream(class reference variable)
(ie) static PrintStream out;
and PrintStream is a predefined class in java.io package.
since its static thats why we are calling
System.out
so System.out means we are getting the reference to the object of type PrintStream

println
-------
println is the method in PrintStream class for Standard output stream.
so to access println method , i need PrintStream object which we are getting through System.out.
so finally
its System.out.println---- to produce standard output Stream
println-method name

Is This Answer Correct ?    65 Yes 11 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Why synchronization is important?

580


What is package private scope in java?

523


Which is the best sorting technique in java?

515


Is null a keyword in java?

549


Why bytecode is called bytecode?

577






What are static initalizers in java ?

570


What are the differences between this and super keyword?

521


What are the differences between throw and throws?

518


What is the difference between the file and randomaccessfile classes?

520


How can an exception be thrown manually by a programmer?

501


Is int a class in java?

519


What is final method in java?

533


What is boolean flag in java?

566


what is collatration?

2735


How do you square a number in java?

545