0
Trycatch
A complition error is not showing when writing print statement after catch block. And showing when written after finally block. This all is happening inside a for loop with a break statement in a try block..? Pls help
4 Respostas
+ 4
Will you please show your code?
0
Psvm(){
for(int i =0 ; i less than 4 ; i++)
{
try{
break;
}
finally{
sysoln(" finally");
}
Sysoln("end");. ------- here is it showing CTE
}
}
0
Nid when you say 'break' the loop is terminated. So as soon as the control reaches the try block, it executes break so the last print statement will never execute. It is an unreachable statement.
0
Psvm(){
for(int i =0 ; i less than 4 ; i++)
{
try{
break;
}
Catch(Exception e){
sysoln(" exep");
}
Sysoln("end");. ------- this is not executing but also not showing error as in the above case
}
}
Executing After catch block