You're reading each line of your file (line 20), and then you're breaking each line into words (line 32) and only using the first word (line 34). If you want to output every word in the line, you're going to have to add them to the list.
I'm sorry but I don't understand what you are asking.
perhaps it would be best if we started over. Tell us what exactly you are trying to do. don't talk using java terms, talk in English. For example:
I have a file of email addresses. The file can have multiple addresses per line, and may have multiple lines. On a given line, a new email address is separated with a semi-colon. A single email address will not be split across multiple lines.
I need to read the file, parse out each email address, and then send a stock email to each address in the list.
From the above, it is fairly clear what I need done. Further, if you read it, you have an idea, or can at least ask me questions to clarify. I haven't really used any 'java' terms. i'm not trying to think as a programmer...I'm trying to explain it to (say) an intern.
Can you do that so we know what you are trying to do?
There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
I have a file of name Songs.txt in that I have written some text separated by blank/space like
"I am enjoying coding, just need guidance"
So first I need to split this by blank space then sort it.
So I think after sorting "am" word come very first
that value should get display, that all I want.