Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

System.out ?

 
mark stone
Ranch Hand
Posts: 417
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
System.out is field of PrintWriter or PrintStream ?
System.err is field of PrintWriter or PrintStream ?
 
Rob Ross
Bartender
Posts: 2205
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
System.out IS a PrintStream.
http://java.sun.com/j2se/1.3/docs/api/index.html
So is error.
PrintWriter is similar to a PrintStream but I was mistaken earlier; System.out and System.err are PrintStream objects.
Rob
 
Valentin Crettaz
Gold Digger
Sheriff
Posts: 7610
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by mark stone:
System.out is field of PrintWriter or PrintStream ?
System.err is field of PrintWriter or PrintStream ?

System.out and System.err are neither a field of PrintWriter nor PrintStream classes.
A field means a member.
But I think what you wanted to ask is of which type both are? Right? Then System.out and System.err are of type PrintStream.
Be careful about the wording mark !!
HIH
 
mark stone
Ranch Hand
Posts: 417
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
out and in are fields of class System. right ?
and we refer to them as System.out and System.in
right ? these are fields.
let me know where i am wrong
Originally posted by Valentin Crettaz:

System.out and System.err are neither a field of PrintWriter nor PrintStream classes.
A field means a member.
But I think what you wanted to ask is of which type both are? Right? Then System.out and System.err are of type PrintStream.
Be careful about the wording mark !!
HIH
 
Marilyn de Queiroz
Sheriff
Posts: 9066
12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by mark stone:
System.out is field of PrintWriter or PrintStream ?
System.err is field of PrintWriter or PrintStream ?
System.out is a field of class System. System.out is a PrintStream. System.out is not a field of PrintStream. Same with System.err

PrintWriter is not involved with System.out at all.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic