Sorting Anagrams
<p>I'm supposed to write an algorithm that sort out anagrams from the given set of words. So far I got this </p>

<pre><code>package Tutorial5;

import java.io.BufferedReader;
import java.io.DataInputStream;
import java.io.FileInputStream;
import java.io.InputStreamReader; 


public class Anagrams {

    /**
     * @param args
     */
    public static void main(String[] args) {

        try{
            FileInputStream fis = new FileInputStream("src/Tutorial5/words"); //locate and open the txt.file

            DataInputStream dis = new DataInputStream(fis); //get the words from the txt.file

            BufferedReader br = new BufferedReader(new InputStreamReader(dis));

            String SLine;


            while ((SLine = br.readLine()) != null) //read the txt.file line by line
            {
                System.out.println(SLine); //print out the words
        }

        dis.close(); //close the DataInputStream

    }
        catch (Exception e) //see if there is any exception to catch
        {
            System.err.println("Error: " + e.getMessage());
        }

}
}
</code></pre>

<p>Can anyone please help me out? I'm struggling with the sorting part. I don't know how to use this code I got and convert it into string and have it sort into anagrams.</p>
