public class Anagram { public static void main (String[] argv) { // A test. String s = "conversation"; String s2 = "conservation"; boolean yes = areAnagrams (s.toCharArray(), s2.toCharArray()); System.out.println ("Are " + s + " and " + s2 + " anagrams? " + yes); // A trickier test. s = "slop"; s2 = "sloop"; yes = areAnagrams (s.toCharArray(), s2.toCharArray()); System.out.println ("Are " + s + " and " + s2 + " anagrams? " + yes); } // The real work is done here. static boolean areAnagrams (char[] A, char[] B) { // Check each letter in A to see if it occurs in B for (int i=0; i