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"
}
}
You'll have to re-write it as a while loop, or something.