define System.out.println(); what is the meaning!

Answer Posted / dheeraj singh rajput

System is a class made available by Java to let you
manipulate various operating system related objects. It's
part of java.lang namespace.

out, being one of those objects, is a static publicly
available object inside that class. The object itself,
representing standard output, is an instance of
java.io.PrintStream class. Standard output is, on most
operating systems, console output.

println is a method of java.io.PrintStream class that lets
you output some text into the stream and, as opposed to
print() method, gets you to the new line after the text.

Check out the source for more information.

[EDIT, answer to "Additional details"] You don't need to
import java.io.* because System is part of available to all
Java calls package java.lang (you don't need to import
that). Even though out is an instance of
java.io.PrintStream, it is still declared *inside* the
System class and therefore, you do not need to import java.io.

Of course, implementation of java.lang.System needs to
import java.io (and many other packages). You can see it in
the source:

Is This Answer Correct ?    2 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is classname class in java?

534


Why does it take so much time to access an applet having swing components the first time?

1396


Is set sorted in java?

518


What will be the default values of all the elements of an array defined as an instance variable?

558


What is treemap in java?

552






Does hashset allow duplicates in java?

580


Explain reverse a linked list recursive java solution?

533


What are the common uses of "this" keyword in java ?

571


What is a qms manual?

548


What are the default and parameterized constructors?

557


Java Compiler is stored in JDK, JRE or JVM?

1052


Why do we declare a class static?

548


Is array primitive data type in java?

538


How do you escape in java?

581


What is a qualifier in a sentence?

529