Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

looping problem with break and continue

 
chinnasamy vijayakumar
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I found this problem with jdk 1.2.2 on RH LINUX VER 6.1
---------------------------
import java.io.*;
public class rectangle
{
public static void main(String args[])throws IOException
{
looping:
System.out.println("1 : update ");
System.out.println("2 : get area ");
System.out.println("3 : get circumference ");
BufferedInputStream b=new BufferedInputStream(System.in);
DataInputStream d=new DataInputStream(b);
System.out.println();
System.out.println();
System.out.println();
System.out.print("Enter the code : ");
String s=d.readLine();
int number=Integer.parseInt(s);

rect re=new rect();
if(number==1){
re.getdata();
continue looping;
}else
{if(number==2)
{
re.area();
}else
{
re.circum();
}
}

}
}
------------------------
The compiler says no label definition found

Why ?
vijay
 
Sivaram Ghorakavi
Ranch Hand
Posts: 56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
labels (ex: loop should immediately be followed a looping for EX:
loop1:
while( i < 10 )
.....
OR
loop2
for(;
....
Hope this helps...
 
chinnasamy vijayakumar
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Mr. Gorakavi
Its worked fine

bye.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic