// 将两个字符串进行排序,再调用equals()方法进行判断
class Solution {
public boolean isAnagram(String s, String t) {
char [] s1 = s.toCharArray();
char [] t1 = t.toCharArray();
Arrays.sort(s1);
Arrays.sort(t1);
String s2 = new String(s1);
String t2 = new String(t1);
return s2.equals(t2);
}
}