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.
public class errorstreamexample { public static void main(String[] args) { if(args.length!=1){ System.err.println("usage: java.run.pathname"); return; } } }
Output
No comments:
Post a Comment