Hi,
In the potential traps as given by Ajith, one of the traps says
Declaration cannot be labelled.
However the following code runs perfectly well.
public class Decl
{
private static void main(
String[] args)
{
label1: float f = 1.3f;
label2 : for(int i=0;i<10;i++)
{
System.out.println(i);
}
}
}
Could anyone explain to me the context in which it is invalid.
Any explanation is truly appreciated.
Thank you.