Java can't compile in the browser - read the steps and type the code into the editor. Run it on your own machine when you're ready (any IDE with a JDK works).
Reference
public int findFive(){
double num = Math.random();
num = num * 10;
int maybeFive = Math.floor(num);
return maybeFive;
}
int number = findFive();
while(number != 5){
System.out.println(number);
number = findFive();
}
System.out.println(number);