Can any one tell me why continue statement is not working in if ? i tried with following code

outA:
 if(userValue==randomValue)
 {
int luck=s.nextInt();
int randNo=(int)(Math.random()*(userValue*2+(1)));
int arrValue=point[i];
arrValue+=userValue;
 point[i]=arrValue;
continue outA ;
}

but it shows error

continue and break are for loops. Not for condition statements.

@adarshcu
It's good that you are trying to contribute here. But did you read the previous post? Did your post add anything new?

@above.

Sorry. I understand. I saw your post after i posted mine. A mistake.

OK. No problem. :-)

Thanks for all your replies.. It's helpful for me...

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.