Class Anagrams

java.lang.Object
it.unimi.di.prog2.h24.Anagrams

public class Anagrams extends Object
A simple program that reads a list of words from standard input and prints all anagrams of size at least 2.
  • Constructor Details

    • Anagrams

      private Anagrams()
      .
  • Method Details

    • signature

      public static String signature(String word)
      Returns the signature of a word, that is, the word obtained by sorting its letters.
      Parameters:
      word - the word.
      Returns:
      the signature of the word.
    • main

      public static void main(String[] args) throws IOException
      Reads a list of words from standard input and prints all anagrams of size at least 2.
      Parameters:
      args - not used.
      Throws:
      IOException - in case some read error occurs.