Below you can see my code. It reads words from dictionary and copy words that match specific patern to test.txt. My qusetion is how to sort words in test.txt first by LENGTH and
Try looking at the Collections framework List might be a good place to start, and look at Comparable/Comparators. That might help.