I have a .txt file that has numbers 1-31 in it called numbers
. I've set up a scanner like this:
cardCreator = new Scanner (new File ("numbers"));
After this, I'm kind of confused on which methods I could use.
I want to set up a conditional statement that will go through numbers,
evaluate each line (or numbers 1-31), and include each number a string called numbersonCard
, if they meet certain criteria.
I can kind of picture how this would work (maybe using hasNext()
, or nextLine()
or something), but I'm still a little overwhelmed by the API...
Any suggestions as to which methods I might use?