• Post Reply Bookmark Topic Watch Topic
  • New Topic

A small question on "err"  RSS feed

 
Neha Mohit
Ranch Hand
Posts: 87
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi ranchers ,

This might be most dumb question ever asked , but i shall be really thankful if any body tells me

What is the use of System.err.println() and
System.err.flush() and

Thanks in advance
 
Rahul Bhattacharjee
Ranch Hand
Posts: 2308
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
System.err.println("HI") would put HI in the error stream of your system.Default is your console for both err and out.
 
Jesper de Jong
Java Cowboy
Sheriff
Posts: 16028
87
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Java has three standard I/O streams: in, out and err. This is one of those things that Java inherited from C, C++ and Unix.

System.in is the standard input stream. It usually reads from the console window.
System.out is the standard output stream. It usually writes to the console window.
System.err is the standard error stream. It also normally writes to the console window.

On some operating systems (particularly Unix) the standard in, out and err streams can be separately redirected. So, by using the redirection syntax of the shell, you could for example redirect out to a file, but leave err to print to the console.

See this for more info:
http://scv.bu.edu/Doc/Java/tutorial/java/system/iostreams.html
[ November 21, 2006: Message edited by: Jesper Young ]
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!