Hi,
i have a scenario for finally block.
try{
system.out.println("try");
}catch(Exception e){
system.out.println("catch");
}finally{
system.out.println("finally");
}
the finally block gets executed irrespective of the try and catch block . Then what is the need of finally block in java.This block gets executed even when the control comes to try as well as catch block,so what is need for finally block,why not a piece of code rather than a finally block.
thanks