so only 10 words will be get from the file? how about it is more than 10 words?
what is word? it is not declared? do you got an error?
so you don't need the loop just by getting a random...
Type: Posts; User: dicdic
so only 10 words will be get from the file? how about it is more than 10 words?
what is word? it is not declared? do you got an error?
so you don't need the loop just by getting a random...
did you successfully read the file? and print it?
please paste your code here. so I can guide you.
Is it possible to program it in just reading a file? So you won't get stuck with other bugs?
And please take a look at http://docs.oracle.com/javase/7/docs/api/java/util/Scanner.html in nextLine()...
Okay, lets solve the first problem. Lets read the file first and store it array.
Since you don't know how many words does the file has, we will use a collection. are you familiar with List?...
First, are the words in the file separated by carriage return (enter/newline) or separated by space?
Second, do you know how many words does the file contains? If you know, you can use a simple...