explain System.out.println
Answers were Sorted based on User's Feedback
Answer / rajashekhar p
exactly System.out.println();
Solution
System is a Predefined public final class in the
java.lang package.
and out is the static variable of type PrintStream.
and println() method is contain in PrintStream class..
Hence we can invoke this method through class name (i.e
System)
code like as follows........
final class System{
static PrintStream out;
}
class PrintStream{
println();
-----------
------------
}
| Is This Answer Correct ? | 1 Yes | 0 No |
Answer / nivrutti
'system' is a public class which is final which can never
be extended..It does not extends object.
'out' is the static variable of the class PrintStream desclared in system class.
'println()' is the method of printStream class..
since 'out' is a static variable it can be called by using
the class name'system'
so 'Sstem.out.println()'
| Is This Answer Correct ? | 1 Yes | 0 No |
Answer / ramu.gadde
System:It is the class Name which is available in java.lang
package.
out: is the static variable(public static final
java.io.PrintStream out)
Analysis of out variable:
So many people are conflict about this out,
a)Either it is object or variable.
Reason:In java there is no static object(means with static
keyword it is called variable only)
println:is a method which is available in
Java.io.PrintStream class)
the step is considered by java team like this
class System
{
public static final java.io.PrintStream out=new PrintStream();
------
}
So they called System.out.println()
I think u understand about this completely.
| Is This Answer Correct ? | 1 Yes | 0 No |
Answer / shyam
It is quite simple to understand the question but to answer it we need to dig deeper in to java native code.
System is static class and cannot be instantiated
out is a reference variable defined in System
println() is the method used to print on standard output.
A <a href = "http://www.javastudychannel.com/forum/2114-What-out-System.out.println-Java.aspx">brief and nice explanation</a> is always welcome on this as we can learn much from this single line of statement itself!!
| Is This Answer Correct ? | 1 Yes | 0 No |
Answer / ramanjaneyulu.b
-->System is a class name
-->out is an object of a class
-->println is the printstream
| Is This Answer Correct ? | 1 Yes | 0 No |
Answer / avinash
in c print and in c++ cout and in java
system.out.println()
system is classand package and out is an object of the
class printstream println is method of the printstream
printing string on console
| Is This Answer Correct ? | 11 Yes | 11 No |
Answer / uday
'system' is a public class which is final which can never
be extended..It itself extends object.
'out' is the static object of the class PrintStream.
'println()' is the method of printStream class..
since 'out' is a static object it can be called by using
the class name'system'
so 'Sstem.out.println()'
| Is This Answer Correct ? | 0 Yes | 0 No |
Answer / ashwani
system has a final class which can never instantiated by
other class. it has a private constructor has private or
private constructor never call, it call by jvm.
out: out is field type of static printer writer.
println: has a method of printsteam .
| Is This Answer Correct ? | 0 Yes | 0 No |
Answer / sachin
System.out.println();
System - System is class
Out - Is an object of output stream (PrintStream class)
which is static and defined in System class.
Println()- Method from PrintStream class which use to write
output
| Is This Answer Correct ? | 0 Yes | 0 No |
Answer / ramu.gadde
System is the class name which is Available in
java.lang.System class
out is a static variable which is also available in
java.lang.System class
println is the method which is available in
java.io.PrintStream class
| Is This Answer Correct ? | 0 Yes | 0 No |
what is polymorphism with example?types of polymorphism?
What is the default initialized value of String type variable?
Can abstract class have private constructor?
Why is java so popular?
if arraylist size is increased from initial size what is the size of arraylist...suppose initial is 100 , if i add 101 element what is the size...
What will happen if we write code like: try{}catch(exception e)catch(IOException i)
how can you catch multiple exceptions in java?
Which java ide is used the most?
What does this () mean in constructor chaining concept?
How java enabled high performance?
Why can't you declare a class as protected?
String is a immutable objects . it means that string does not change........... But it will be chang......... { String s="kapil"; String s1="raj"; String s=s1; then print(.......) The String has been changed .. how it is possible and why its called immutable objects