try{
if((Boolean)ppb.getParameters().get("abc")){
Sysout.print("if true it goes inside else continue the code below");
}
System.out.print("if classcastexception print this")
}catch{
System.out.print("classcastexception but neverprint out");
}
When I start the debug mode(Eclipse), the code keep running well,
even there is a try catch block, but never go inside the block.
But when I use CNTRL-SHIFT-I
to check the value of
(Boolean)ppb.getParameters().get("abc")
, it says "ClassCastException".
So here are my questions:
When the value of
ppb.getParameters().get("abc")
is a String type, casting it to Boolean throws a exception. But why does it keep running? Why does it never go into the try catch block?Since it running well without interruption, should I handle this exception or not?