[java] newbie ques. Protected modifier?

Started by
9 comments, last by CodyVa 23 years, 7 months ago
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
"We who cut mere stones must always be envisioning cathedrals"

This topic is closed to new replies.

Advertisement