This code:
print(" - Start");
int[] num = new int[] {1,2,3,4,5,6,7,8,9,10};
for(int i : num)
{
print("--> "+ i);
try
{
print(" . try");
if(i == 2)
break;
}
catch (java.lang.Exception e)
{}
finally
{
print(" . finally");
}
}
print(" - End");
Does not work as expected. I.e. the break
seems not to work.
Can anyone explain why this is?