Im a beginner with java and i am following tutorials by Thenewboston on youtube. I wanted to go to a bit more advanced (in my opinion... but not really) things. So heres the c
Something like this:
Double test;
Scanner alex = new Scanner(System.in);
while (alex.hasNextDouble()) {
test = alex.nextDouble();
if (test == 9){
System.out.println("eat");
continue;
}else{
System.out.println("do not eat");
break;
}
}
Note: Assuming all inputs are double, otherwise this program may fail.
This is not perfect example too, because even though you don't say continue while loop iterates. It may be good example for break.