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

When is finally block not called?

584


why are wait(), notify() and notifyall() methods defined in the object class? : Java thread

555


What are the java ide's? Explain

525


What is the concatenation operator in java?

580


Is it possible to cast an int value into a byte variable? What would happen if the value of int is larger than byte?

550






Explain the meaning of java applet.

608


What is array in java?

537


What is difference between path and classpath in java?

487


What is deserialization?

587


hr interview how many minutes asking question

1571


What value is a variable of the string type automatically initialized?

615


How to make a write-only class in java?

579


Explain java thread life cycle.

583


What is the difference between delete and delete[]

586


How garbage collection is done in java?

551