File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Beginning Java and the fly likes System.out.println( ); Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "System.out.println( );" Watch "System.out.println( );" New topic

System.out.println( );

Larry Lai
Ranch Hand

Joined: May 13, 2002
Posts: 44
Hi everyone,
This question may be too simple but I really want to know because a lot of books would be read that the first topic (getting start) as follows:
System.out.println("Hello Javaranch!!! How're you ?");
What's that ?
I mean System.out.println("Hello Javaranch!!! How're you?");
// objectname.methodname();
Is it correct?

Rodney Woodruff
Ranch Hand

Joined: Dec 04, 2001
Posts: 80
The System class is included by default in all your executing programs as it is apart of java.lang package.
The System class contains several class fields such as out, in and err which allow various types of output and input operations such as the overloaded println() method.
Check here System Class and then post more questions if you have any.
[ May 23, 2002: Message edited by: Rodney Woodruff ]

Hope This Helps
Thomas Paul
mister krabs
Ranch Hand

Joined: May 05, 2000
Posts: 13974
System is a class.
out is a static PrintStream object of System.
println is a method of PrintStream.

Associate Instructor - Hofstra University
Amazon Top 750 reviewer - Blog - Unresolved References - Book Review Blog
Thomas Paul
mister krabs
Ranch Hand

Joined: May 05, 2000
Posts: 13974
You could do something like this if you wanted:
PrintStream p = System.out;
Manish Hatwalne
Ranch Hand

Joined: Sep 22, 2001
Posts: 2591

More accurately in, out and err are static members of the System class, where err and out are objects of type PrintStream, and in is an InputStream object. Hence it is essentially objName.methodName(), where objects are static members of System class, so you do not need an instance of System class to access them.
- Manish
I agree. Here's the link:
subject: System.out.println( );
jQuery in Action, 3rd edition