import static java.lang.system.err;
import static java.lang.system.out;
import java.io.ioexception;
import java.io.printstream;
public class staticimporter {
public static void writeerror(printstream err, string msg)
throws ioexception {
// note that err in the parameter list overshadows the imported err
err.println(msg);
}
public static void main(string[] args) {
out.println("good morning, " + "java2s");
out.println("have a day!");
try {
writeerror(system.out, "error occurred.");
} catch (ioexception e) { e.printstacktrace();
}
}
}
import static java.lang.system.out;
import java.io.ioexception;
import java.io.printstream;
public class staticimporter {
public static void writeerror(printstream err, string msg)
throws ioexception {
// note that err in the parameter list overshadows the imported err
err.println(msg);
}
public static void main(string[] args) {
out.println("good morning, " + "java2s");
out.println("have a day!");
try {
writeerror(system.out, "error occurred.");
} catch (ioexception e) { e.printstacktrace();
}
}
}
闽公网安备 35060202000074号