When u catch an exception, unless u do a System.exit() or a return, then the next statement after the exception block will be executed... for example:
public class Foo
{
public static void main(String[] args)
{
try
{
throw new RuntimeException("ARRGGHH");
}
catch(RuntimeException e)
{
}
System.out.println("No problems, heh, heh.");
}
}
Right, the above code throws a RuntimeException, the catch, catches it, does nothing and the code runs onto the System.out.println statement.
Hope this helps, if you want to try the example out, stick it in a file called Foo.java
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement