Application standard output and standard error output can interleaved
Handling Exceptions in an Application
Due to the nature of some IDEs, an application's standard output and standard error output can be interleaved. For example, the execution of the above sequence may result in the following output. You may not or may see the interleaving in your output.
|
|
---|---|
|
|
Returns the string version of the message. |
---|
Notice that the first line of the printStackTrace method is the output of the toString method.
System.out.println();
StackTraceElement traces[] = e.getStackTrace(); for (StackTraceElement ste : traces) {
System.out.println(ste);
}
}When executed we get the following output:
However, a finally block will not execute if the System.exit | ||
---|---|---|
|