goto statements in java

Posted by user238284 on Stack Overflow See other posts from Stack Overflow or by user238284
Published on 2010-12-28T16:46:38Z Indexed on 2010/12/28 16:53 UTC
Read the original article Hit count: 295

Filed under:
|

I executed the below code in Eclipse, but the GOTO statements in it is not effective. How to use it?

case 2:
**outsideloops:**
System.out.println("Enter the marks (in 100):");
System.out.println("Subject 1:");
float sub1=Float.parseFloat(br.readLine());
             **if(sub1<=101)

goto outsideloops;**
System.out.println("Subject 2:");
float sub2=Float.parseFloat(br.readLine());
System.out.println("Subject 3:");
float sub3=Float.parseFloat(br.readLine());
System.out.println("The Student is "+stu.average(sub1,sub2,sub3)+ "in the examinations");
break;

© Stack Overflow or respective owner

Related posts about java

Related posts about goto