Ok Cambell. I'm left to guess at your intent because your words are not precise enough. So, this? No. It doesn't work either, whereas my post a few back did work. Can you show me?
Campbell Ritchie wrote:Afraid you aren't. Why is he using Strings instead of booleans in the first place?
Carey Brown wrote:. . . I think I'm following your suggestion here, . . .
You are also not calling nextLine() before line 3. That will throw all your lines out of sequence, and will cause all sorts of problems. You will probably be lucky and get an exception.
I added line 44 prior to running this. I think I'm following your suggestion here, but it doesn't work.
Campbell Ritchie wrote:Suggestion to avoid the exception: stop reading when there is no more text. To do that, replace while (myScanner.hasNextLine())... with while (myScanner.hasNext())... I think deleting four letters will obviate the exception good and proper.
Eclipse is an excellent tool but I caution against it for the short term. If you are just starting out with HelloWorld, using the command line will help you understand how the organization of a Java project works. Eclipse, of course, helps with this, but you may have trouble understanding errors in Eclipse without some of this background knowledge. Eclipse also has its own learning curve.
Chad Dunlosky wrote:Everything worked like it should, but I think I'll use Eclipse to better practice java, even though there's nothing wrong with the command prompt, all guides I read have Eclipse as recommended.