ID:276987
 
Problem description:
How would I make it go back to the little label I have called "start" in the code. I was looking for something similiar to "goto" in the DM language.
Code:
public class Main
{
public static void Main(String args[])throws IOException
{
// "Start"
BufferedReader stdin = new BufferedReader(new InputStreamReader(System.in));
char Name_Array[] = new char[100];
char Temp;
char Getkey;
System.out.println("Please enter a name. Enter * to end.");
int X = 0;
do
{
Temp = (char)stdin.read();
if(Temp !='*')
Name_Array[X] = Temp;
X = X+1;

}
while(Temp!='*');
{
Getkey = (char)stdin.read();
Getkey = (char)stdin.read();

}
for(int Y=0;Y<Name_Array.length;Y++)
System.out.print(Name_Array[Y]);
if(Name_Array.length<=0);
System.out.println("You didn't enter a name.");
// I need it to go back to "Start"


}
}




There is no goto statement in Java.

You'll have to re-write it as a while loop, or something.
In response to Jp
Jp wrote:
There is no goto statement in Java.

You'll have to re-write it as a while loop, or something.

It's sweet that there isn't one
In response to Crashed
Care to state whats wrong with java?
In response to Brind
It's crufty, slow, and horrible.
In response to Brind