+1 to Daniel DiPaolo. I thought I'd post a separate answer to provide clarification of why this is the case.
While loops in Java can be written in one of two ways. If there is just one line to the body of the loop, you can write them in a short-hand fashion:
while (true)
System.out.println("While loop");
This will print out "While loop" on the console until the program ends. The other option is to specify a loop body between braces, as you have done above:
int i = 0;
while (i < 10) {
System.out.println("i = " + i);
i++;
}
This will print out "i = 0", "i = 1", ..., "i = 9" each on a separate line.
What the code you posted does is confuse the two. In the short-hand while loop, the Java parser expects to find a statement between the while loop condition and the semi-colon. Because it does not find a statement here, the while loop runs, but does nothing; it has no body. Furthermore, because the loop has no body, there is no opportunity for your variable r to assume a new value; the condition always evaluates to true and the loop never exits.
If you were to negate the condition in the while loop in your example, i.e.,
boolean r = false ; int s = 0 ;
while (r != false) ;
{
s = getInt() ;
if (!(s>=0 && s<=2)) System.out.println ("try again not a valid response") ;
else r = true ;
}
(note I left the erroneous semicolon in there), you would find that your intended loop body would execute precisely once, as the loop would never run.