• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

System.out.println()

 
meraman odedra
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have one query plz explain me

here
System.out.println();
What is System?
What is out?
What is println()?
thanx
 
Ilja Preuss
author
Sheriff
Posts: 14112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Frankly, this sounds very much like a homework question, so I'm reluctant to give you a straight answer.

What do you know about Java or OOP? Do you know what a class is? A field? A method?

Anyway, moving to Java in General (beginner), where this question really belongs...
 
Marco Vanoli
Ranch Hand
Posts: 99
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by meraman odedra:
I have one query plz explain me

here
System.out.println();
What is System?
What is out?
What is println()?
thanx


I try to respond but i am a beginner to so anybody could correct me.

Deduction looking javadoc:

System is a java.lang class. From javadoc :
The System class contains several useful class fields and methods. It cannot be instantiated. Among the facilities provided by the System class are standard input, standard output, and error output streams; access to externally defined properties and environment variables; a means of loading files and libraries; and a utility method for quickly copying a portion of an array.

out is a static field of the system class, it contains an object PrintStream that rapresent the standard output, wich by default is the console.
From javadoc :
The "standard" output stream. This stream is already open and ready to accept output data. Typically this stream corresponds to display output or another output destination specified by the host environment or user.
For simple stand-alone Java applications, a typical way to write a line of output data is:
System.out.println(data)
See the println methods in class PrintStream.

println() is a method of PrintStream class.

So at the end i suggest you to look at java documentation and try to understand all base classes as java.lang package.
 
marc weber
Sheriff
Posts: 11343
Java Mac Safari
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Marco Vanoli:
...i suggest you to look at java documentation and try to understand all base classes as java.lang package.

Excellent advice!
 
Rick Portugal
Ranch Hand
Posts: 243
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Seems like overkill to me. java.lang contains all sorts of classes. It is not necessary to learn about SecurityManager and ThreadGroup if you just want to understand how to print something.
 
marc weber
Sheriff
Posts: 11343
Java Mac Safari
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Rick Portugal:
Seems like overkill to me. java.lang contains all sorts of classes. It is not necessary to learn about SecurityManager and ThreadGroup if you just want to understand how to print something.

Yes, you're probably right about that. I just thought that going to the API documentation for these types of questions is the best approach.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic