Reputation: 57
I'm new to programming, so I was wondering if someone could help me. What I'm trying to is make the user input a number, and if the number is in the file, it'll spit something back out, and if it's not in the file, it'll keep asking for a number. I don't know exactly how to do this, but if someone could point me in the right direction, that would be great. Thanks in advance!
Upvotes: 1
Views: 42
Reputation: 178451
Collection
, or as a big
String
, the exact type depends on how you actually trying to
achieve this).
Scanner
, BufferedReader
or File.readAllLines()
Bonus:
Try to do each of the bullets in a different method and only combine them in your main()
- it will help you to learn about basic methods design as well.
Upvotes: 4