explain System.out.println

Answer Posted / vishal

System :
Its a built-in class present in java.lang package.
This class has a final modifier, which means that, it cannot
be inherited by other classes.
It contains pre-defined methods and fields, which provides
facilities like standard input, output, etc.

out :
Its a static final field (ie, variable)in System class
which is of the type PrintStream (a built-in class, contains
methods to print the different data values).
static fields and methods must be accessed by using the
class name, so ( System.out ).

out here denotes the reference variable of the type
PrintStream class.

println() is a public method in PrintStream class to print
the data values.
Hence to access a method in PrintStream class, we use
out.println() (as non static methods and fields can only be
accessed by using the refrence varialble)

System.out.println();

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is a char in java?

541


What is diamond operator in java?

503


Why is boolean important?

596


how to convert Java project into Maven ?

591


What is the final method?

606






What are the differences between graph and tree?

651


Give reasons supporting that string is immutable.

504


Does java support multiple inheritances?

561


Why does java does not support multiple inheritance? Explain

553


How we can generate random numbers in java?

612


What is the default size of arraylist in java?

511


What is double checked locking in singleton?

617


What does the string method compareto () do?

540


When is the finally clause of a try-catch-finally statement executed?

506


What is the purpose of java?

562