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

What is number data type in java?

0 Answers  


What is considered an anti pattern?

0 Answers  


List some oops concepts in java?

0 Answers  


What is printwriter in java?

0 Answers  


How to sort array of 0 and 1 in java?

0 Answers  






Is delete, next, main, exit or null keyword in java?

1 Answers  


What is the exact difference in between Unicast and Multicast object ?

4 Answers   Accenture,


why we are calling j2se why not j1se or j3se or j4se..etc is there any reason.. can u please explain it... i shocked in my interview when they asked this question please explain ans

2 Answers   Infosys,


What is the purpose of main function in java?

0 Answers  


What are the two ways in which thread can be created?

0 Answers  


What are the core java topics?

0 Answers  


What does || mean in vectors?

0 Answers  


Categories