posted 17 years ago
In Example 1, when you are trying to access the file, I think that the file is present (even if the file is not present, File f = new File() creates the file), and there is no FileNotFoundException. But you are forcefully throwing an exception. In that case the throw statement is executed.
In Example 2, there is a ClassNotFoundException, as you are trying to load a class which is not present. In this case, the control goes to the catch block rather than executing the second line (in which you throw the exception). I hope I make sense to you.
[ December 27, 2006: Message edited by: Anu Pillai ]