Hi All,
Recently I have been trying out exception printing and ran across strange behaviour. I just noticed that e.printStackTrace() actually prints the message at the end of everything...... does any body know why ?
----------------------------------------
here is my code...
------------------------------------------
public class ExceptionTrial
{
public static void main( String arguments[] )
{
try
{
int i=1;
i=i-1;
int b=3/i;
}
catch (Exception e)
{
System.out.println( "\nprintStackTrace Should Start here------\n" );
e.printStackTrace();
System.out.println( "\nprintStackTrace Should End here------\n" );
}
}
}
---------------------
The result
------------------------
printStackTrace Should Start here------
printStackTrace Should End here------
java.lang.ArithmeticException: / by zero
at ExceptionTrial.main(ExceptionTrial.java:10)
????????????????? Why is it printing the message at the end ???????????