try this(asume there is no file abc.txt)
public class TRYCATCH {
public static void main(
String[] args) {
try{
System.out.println("before call");
TRYCATCH.method();
}catch(Exception e){
System.out.println(e.getMessage());
}
}
private static void method()
{
File f = new File("c:/abc.txt");
try{
System.out.println("===before fis====");
FileInputStream fis = new FileInputStream(f);
System.out.println("===after fis====");
return;
}
catch(Exception e){
System.out.println("===in catch====");
return;
}finally{
try{
FileInputStream fis = new FileInputStream(f);
System.out.println("===in finally====");
return;
}catch(Exception e){
System.out.println("===inside finally catch====");
}
}
}
}