explain System.out.println

Answer Posted / gaurav kamra

System.out.println()

System is 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 is 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();

eg:

int i = 3;
System.out.println(i);


the above code prints the value of 3 in the screen and
brings the control to the next line.

Is This Answer Correct ?    2 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How many tetrahedral voids are there in bcc?

544


What is string literal in java?

555


Differentiate between static and non-static methods in java.

569


Can we write multiple catch blocks under single try block?

575


What are the restrictions imposed by a Security Manager on Applets?.

2064






How the metacharacters are different from the ordinary characters?

564


Give a brief description of java socket programming?

527


hi am an engineering student and my next plan is for ms in either in us or australia i got my passport but i dont know anything bout visa can u give brief idea 1)How to get prepared for visa and 2)How to apply for top universities and 3)How to pay the fee and so on These all are basic questions plz give me a clear idea

1460


Is hashset ordered?

551


What is reflexive association?

1010


Why do we use predicate in java?

558


What is the difference between ArrayList and Vector? which one is better in Java

605


What is an immutable object?

587


What is regex in java?

529


What is the maximum size of byte array in java?

540