This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes println() method Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "println() method" Watch "println() method" New topic

println() method

rajeshchowdary rajesh

Joined: Nov 21, 2007
Posts: 3
to access methods we can create ojects to the classes to which the method belongs .and by using objectname.methodname() we can access methods.But we are using System.out.println() why ? is there any other alternate to access println method ehich is in printstraem class?
Peter Chase
Ranch Hand

Joined: Oct 30, 2001
Posts: 1970
java.lang.System is a class.

"out" is a static field of the System class. Being static, it exists independent of an instance of the System class. The type of "out" is

So, "System.out" gives you an instance of PrintStream, on which you are calling the method println().

Betty Rubble? Well, I would go with Betty... but I'd be thinking of Wilma.
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
subject: println() method
Similar Threads
null pointer exception
about System.out.printnln()
doAfterBody() in custom Tags
Eliminating Parenthesis within custom internal DSL