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 meant by design patterns?

674


What is exception hierarchy in java?

660


What is meant by local variable and instance variable?

705


What does void * mean?

606


Can a class with private constructor be extended?

583






Is set ordered?

627


How do you execute a thread in java?

606


Which collection is thread safe in java?

594


How do you input a string in java?

606


What java ide should I use?

644


What are the differences between string, stringbuffer and stringbuilder?

613


Who found java?

652


What are scriptlets?

668


What are the advantages of passing this into a method instead of the current class object itself?

1265


What is object english?

678