Home Java Java-get-example Java error stream



Java error stream
Posted on: November 3, 2008 at 12:00 AM
The Java error stream is used to print error that arises during the execution of a program.

Java error stream

     

The Java error stream is used to print error that arises during the execution of a program. The execution of program display an output and error to the different stream that allows the user to move them to different pages thereby isolating them. The output stream is used for command output, that is used to print the output of a command to a user.

Understand with Example

In this Tutorial we want to describe you a code that help you to understand java error stream, For this we have a class name'errorstreamexample'.Inside the main method if we have the length of the argument is not equal to 1.The System.err.println  display an message as passed in the argument of it. The  most often used from class System are the standard output error and standard error stream, these are the variable of System class.

System.err.println-This is Similar to System.out.println that is used to print the result.

errorstreamexample.java
public class errorstreamexample {

  public static void main(String[] args) {
 if(args.length!=1){
 System.err.println("usage: java.run.pathname");
 return;
 }
  }

}

Output


Download code

Related Tags for Java error stream:
javacerrorcomdiffiousersedprintoutputstreamdisplaycommandpageexecuriintexemoveifforprogramtopagesexecutionramwseisocommaputsplusemanindifferentmntoutplaytrjispesemallageprocutsxespsoatishalleaduandarstrvautissriringrenthavstatihatdispfeebylatinplprmovndonomogrolo


More Tutorials from this section

Ask Questions?    Discuss: Java error stream  

Post your Comment


Your Name (*) :
Your Email :
Subject (*):
Your Comment (*):
  Reload Image
 
 

Ask Questions?

If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.

Ask your questions, our development team will try to give answers to your questions.