Anagram In Java

 Any word or phrase that exactly reproduces the letters in another order is an anagram. Example: cat – act, study – dusty, gainly – laying etc., Logic for anagram is below:

Output: