explain System.out.println

Answer Posted / kamineni

Here System is a class available in java default package
java.lang.. It contains fields and methods that support
standard input n output facilities.System class has Final
modifier so it cant be inherited..
out is a static field in System class of PrintStream
type(printstream is a built in class contains methods to
print different data tyes)
println is the method of the printstream class to print
different values..
Example:
class System
{
static PrintStream out;
'
'
'
'
}
class PrintStream
{
void println();
void print();
'
'
'
}

System.out.println() means
System is a class and out is a static field so we acces it
by using class name..
so System.out
and println is a method of PrintStream..so non static
methods should access using reference or object and out is
the reference(holds the adress of PrintStream object) of
PrintStream so we access it using out..
so System.out.println()..

Is This Answer Correct ?    2 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are adapter classes?

597


What are the topics in core java?

527


What do you mean by inner class in java? Explain

582


What is a consumer in java?

562


Can we have return statement in finally clause? What will happen?

510






Difference between object and reference?

676


What is the difference between integer parseint and integer valueof?

543


What does localhost mean?

492


How do you compare characters in java?

515


What is java full form?

520


What is the function of character?

522


How can you read content from file in java?

595


Tell some latest versions in JAVA related areas?

554


What is array command?

553


What is unmodifiable list in java?

530