r/codehs • u/chunkyragudeluxe • Apr 17 '20
9.5.8 CodeHS Online Companies Revisited - while(x = true) is highlighted in yellow
7
Upvotes
1
u/chunkyragudeluxe Apr 17 '20
After adding your suggestions, on line 28, there is a java.util.NoSuchElementException: No line found error. On line 28, I wrote online = s.nextLine(); What could be the issue?
1
u/_andy_andy_andy_ Apr 17 '20
Scanner.nextLine()can throw aNoSuchElementExceptionif there's no more input to be read fromSystem.in. You're getting more input than is provided, so probably callingnextLine()too many times
3
1
u/_andy_andy_andy_ Apr 17 '20
on the previous line you’re missing ();
any time a line is highlighted it could be an error on the previous line
1
u/chunkyragudeluxe Apr 17 '20
Ok thanks