import [Link].
Arrays;
public class Anagram {
public static void main (String [] args) {
String str1="Brag";
String str2="Grab";
//Converting both the string to lower case.
str1 = [Link]();
str2 = [Link]();
//Checking for the length of strings
if ([Link]() != [Link]()) {
[Link]("Both the strings are not anagram");
}
else {
//Converting both the arrays to character array
char[] string1 = [Link]();
char[] string2 = [Link]();
//Sorting the arrays using in-built function sort ()
[Link](string1);
[Link](string2);
//Comparing both the arrays using in-built function equals ()
if([Link](string1, string2) == true) {
[Link]("Both the strings are anagram");
}
else {
[Link]("Both the strings are not anagram");
}
}
}
}