Hello newbie here, I'm trying to read lines from a textfile and count all the words using
String Tokenizer. However I keep getting an error "Unhandled exception type FileNotFoundException" on my
IDE(Eclipse) referring to lines 13 and 8. When I let the IDE automatically, and I've even tried typing this manually, insert a try-catch block more errors show up concerning inputFile. When I insert the throws FileNotFoundException for each method it compiles but after running it gives me a FileNotFoundException for textfile.txt. What's even more interesting is that when I copy the .java file out of the IDE project folder, place it in a random empty folder on the Desktop with the textfile.txt, and try running it through command line, it gives a NoSuchElementException: No line found.
Here is my textfile:
cat
dog
rat
fish
car,automobile,vehicle
up,down,left,right
arrow,zebra
one,two,three,4,5,six,77777
ten,twenty,thirty-three,forty;fift