explain System.out.println

Answers were Sorted based on User's Feedback



explain System.out.println..

Answer / anuram

System is a class. out is the object of PrintStream class .
println() is the instance method of PrintStream class.to
call that println() we need object of PrintStrem class but
the out is declared as static datamember of System class.So
to call println() befor we call static datamember out using
class name bcoz static datamember can be called by using
class name after that by using out object we can call println().

so System.out.println()

Is This Answer Correct ?    1 Yes 0 No

explain System.out.println..

Answer / gov@

println() is method belongs to the printstream class.
How we can call a method in java? using object of the class to which the method belongs to.now out is the object of the printstream class,so we can call println() method using out.println(),now System.out.println(),here system is the class name [we know static members of a class can be accessed using classname.methodname or classname.members)since out is not a method so the object can be declared as a static variable of System class.

Is This Answer Correct ?    1 Yes 0 No

explain System.out.println..

Answer / sarbbottam bandyopadhyay

System is a class, which belongs to package java.lang
out is a class variable (static final field) of system class of PrintStream class.
PrintStream class has the method println().
The return type of println() is void and has overloading.
Please refer to the API documentation of System class.
http://download.oracle.com/javase/1.4.2/docs/api/java/lang/System.html

Is This Answer Correct ?    1 Yes 0 No

explain System.out.println..

Answer / narasimhulu

System is a final class in java.lang package, which is the
default package in Java.
out is a static variable in System class.
println() is a method of PrintStream class which is in
java.io package
in the system class
static printstream out;
so "out" acts as a reference for PrintStream class and also
static variable in System class.
so finally it produces the output to the console(character
using as input)

Is This Answer Correct ?    1 Yes 0 No

explain System.out.println..

Answer / santosh singh

'System'is a class in it out is a field defined as static
so we can write System.out
out is object defined in PrintStream class in printstream
class tere is a method println()so we can call that method
by out.println()printstream class is defind in java.io
package so if we want to use it so we import java.io package
so it is better to cal system.out.println()it give the same
result

Is This Answer Correct ?    1 Yes 0 No

explain System.out.println..

Answer / rajeshbg

Syatem.out.println() --> 1. System is a class, which is final.
2. out is the static variable in
System class of type PrintStream.
3. println() is the mathod in
PrintStream class.

See below code,

Public class PrintStream
{
Public void println();
}

final Public class System
{
Public static PrintStream out;
}

Is This Answer Correct ?    1 Yes 0 No

explain System.out.println..

Answer / neojava

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)

Is This Answer Correct ?    1 Yes 0 No

explain System.out.println..

Answer / prateek

System is a class
out is a static member in system class, which(out) is
already an object of PrintStream class
and finally
Println() is a method defined in PrintStream class...

Is This Answer Correct ?    1 Yes 0 No

explain System.out.println..

Answer / umrao s rawat

System is a class.
out is referring to PrintStream Class.
Println is the method of PrintStream Class.

Is This Answer Correct ?    1 Yes 0 No

explain System.out.println..

Answer / saurabh pal

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 ?    1 Yes 0 No

Post New Answer

More Core Java Interview Questions

When we can access the static data member without creating the object what is the need of the object in java.

5 Answers   Airhub, ssinformatics,


how to run servlet program between two computer through the internet ?

2 Answers   Kiran Prakashan, TCS,


what is the use of private constructor in core java?

3 Answers   OnMobile, Satyam, Yash Technologies,


How a variable is stored in memory?

0 Answers  


Describe inheritance as applied to java?

4 Answers  






Can subclass overriding method declare an exception if parent class method doesn't throw an exception?

0 Answers  


What is the static variable?

0 Answers  


What are the super most classes for all the streams?

0 Answers  


What is the default access specifier for variables and methods of a class?

0 Answers  


How can you add and remove nodes in jtree?

0 Answers  


What is externalizable interface?

0 Answers  


What is the purpose of the finalize() method?

0 Answers  


Categories