Write a method to find if 2 given Strings are anagrams. Write a main method that calls this method with 2 Strings and prints the result 2 words are anagrams if they are of equal length and made of same characters but the order of occurrence might be different (Remember Java is case sensitive. So make sure to use the burn methods given by String class to stick with either uppercase or lowercase) Sample input: Enter word 1: listen Enter word 2: silent Expected output: listen and silent are anagrams Sample Input: Enter word #1: hello Enter word #2: he Expected output: hello and he are not anagrams Show transcribed image text Write a method to find if 2 given Strings are anagrams. Write a main method that calls this method with 2 Strings and prints the result 2 words are anagrams if they are of equal length and made of same characters but the order of occurrence might be different (Remember Java is case sensitive. So make sure to use the burn methods given by String class to stick with either uppercase or lowercase) Sample input: Enter word 1: listen Enter word 2: silent Expected output: listen and silent are anagrams Sample Input: Enter word #1: hello Enter word #2: he Expected output: hello and he are not anagrams
Expert Answer
Answer to Write a method to find if 2 given Strings are anagrams. Write a main method that calls this method with 2 Strings and pr…