exception handling and reprompting

Java
boolean flag = false;
while(!flag)
{
//make the loop break, if no exception caught
flag = true;
    try{

    }
    catch{
       //make the loop repeat
       flag = false;
    }
 }
Source

Also in Java: