Check if two strings are anagrams or not in java

By | July 22, 2018

This post is all about write a java program to check if two strings are anagrams or not in java

Write a Java program to find whether the given strings are anagrams or not is a very frequently asked interview question these days no matter how much experience do you have.

What is an anagram?

We can say that two strings are called anagrams if we can rearrange the letters of one string to produce the second string, using all the letters of the first string only once. While doing that, usually, you don’t consider spaces and punctuation marks.

Few examples  Like-“Listen”and “Silent”,forty five” and “over fifty”, “restful” and “fluster”

If you run above program in your favourite IDE then you will get blow output:

You would love to watch me on YouTube:

That’s all about this post How to check  if two strings are anagrams or not in java
If you have any feedback or suggestion please feel free to drop in blow comment box.

Leave a Reply

Your email address will not be published. Required fields are marked *