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
Wrap your code around while loop and use break to come out of loop if your condition is true.
while
break
while((alex.hasNext())) { test = alex.nextDouble(); if (test == 9){ System.out.println("eat"); break; }else{ System.out.println("do not eat"); } }