Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

do while ??

 
zzzzzzz zzzzzzzh
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
System.out.println("escolhe 1 ....es.. 2 ou 0");
repetir = false;
switch(Teclado.intLido()) {

case 1 : System.out.print(x);break;
case 2 : System.out.print(x);break;
case 0 : System.out.print(x);break;
default : { repetir = true;
// voltar a pedir pa escolher a op�ao caso ela n exista
}
}
}while (repetir = false) ;

forget the code. i just want to do a "do while" loop
with the those three cases.
if the answer is != 1 || 2 || 0
it asked again .

THANKS
 
Barry Gaunt
Ranch Hand
Posts: 7729
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please take a look at our JavaRanch Naming Policy and change your displayed name to comply with it. We require a displayed name in the form of <first name><space><family name>, preferably your real name. A profile with a displayed name as you have chosen will be locked out if you persist using it.
Thanks
-Barry
 
jiju ka
Ranch Hand
Posts: 308
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic