Hi,
please would anyone clear my doubt.
1)
assume x=0
public class testclass
{
public void
test(int x)
{
loop:for(int i=1;i<5;i++)
{
for(int j=1;j<5;j++)
{
System.out.println(i);
if(x==0)
{continue loop;
}
System.out.println(j);//line 1
}
the output given is 1234.
but i think it should be compile time error as the statement
on line 1 is never reached.
2)
when an exception is caught in the catch clause and after the finally is executed do the remaining statements execute.
example
public testclass
{
public static void main(
String args[])
{
int k=0;
try
{
int j=5/k;
}
catch(ArithmeticException e)
{System.out.println("1");
}
catch (RuntimeException e)
{System.out.println("2");
]
finally
{
System.out.println("3");
}
System.out.println("4");
}
}
Will the output be 134 or 13