| Author |
About System.out.println() method
|
Venu Babu Ravi
Greenhorn
Joined: Jun 08, 2010
Posts: 15
|
|
1)Can any one expline about System.out.println() method ?
2)How we can call System.out ?
3)How we can call out.println()?
Thanks in Advance ....
|
venubabu.ravi
|
 |
Abimaran Kugathasan
Ranch Hand
Joined: Nov 04, 2009
Posts: 2066
|
|
System is a Class in Java API. out is a static field in that System class, So you called with 'System.out' as usual.
Have look at this API
println() is a method of the class PrintStream, since the System class has the the static instance(out) of this class(PrintStream), we invoked println() method on top of that instance
Have look at here
|
|BSc in Electronic Eng| |SCJP 6.0 91%| |SCWCD 5 92%|
|
 |
Prasad Kharkar
Ranch Hand
Joined: Mar 07, 2010
Posts: 438
|
|
System is a class in java
out is the static field of System class that gives us the PrintStream for output
println() method prints whatever text is provided in it and goes to the next line
it is fully defined as
as it is static field we call it using the class name i.e. System.out
Now printlln() is the method defined in the PrintStream class and we are calling the println() method using PrintStream object got using System.out
hence in short
System.out.println()
means that print a line of text and go the next line on the output stream of the System.
about your third question
you have to read a little about static imports
you can find it herehere
|
SCJP 6 [86%] June 30th, 2010
If you find any post useful, click the "plus one" sign on the right
|
 |
Seetharaman Venkatasamy
Ranch Hand
Joined: Jan 28, 2008
Posts: 5575
|
|
Venu Babu Ravi wrote:1)Can any one expline about System.out.println() method ?
from source file of PrintStream in Java API., so it just give you the new line/emptyline.
Venu Babu Ravi wrote:2)How we can call System.out ?
Generally, System.out called as variable which point to the PrintStream object
Venu Babu Ravi wrote:3)How we can call out.println()?
using the PrintStream object's reference you are calling the method of println.
hth
|
 |
Hebert Coelho
Ranch Hand
Joined: Jul 14, 2010
Posts: 754
|
|
You can call out.println() by making a Static Import.
its like:
C Ya
|
[uaiHebert.com] [Full WebApplication JSF EJB JPA JAAS with source code to download] One Table Per SubClass [Web/JSF]
|
 |
 |
|
|
subject: About System.out.println() method
|
|
|