Tuesday , December 6 2016
Home / JAVA / Java Program to find Anagrams Words

Java Program to find Anagrams Words

Anagrams Program in Java:

Anagrams means different combination, the result of rearranging the letters of a word to produce new words or we can say the possible string we make by rearranging the letter of word. Anagrams of a word is to get all the permutation of a word. Here we have provided a simple anagram code in Java and there are 2 Methods to find a Anagram of a word.

Example:
Anagram of the word ‘ABC‘ are : ABC, BAC, BCA, ACB, CAB, CBA

Also you can see other solutions as we have Anagrams program in Python too for those who love to code in Python Language.

  • Output:

    Permutations for XYZ are:
    YXZ, YZX, XYZ, XZY, ZXY, ZYX

    Permutations for MOM are:
    OMM, MOM, MMO

  • Output:

    Enter a word : ABCD

    The Anagrams are :
    ABCD
    CADB
    BCAD
    BACD
    DABC
    ABDC
    DCBA
    ADBC
    ADCB
    DBAC
    CBDA
    CBAD
    DACB
    ACBD
    CDBA
    CDAB
    DCAB
    ACDB
    DBCA
    BDAC
    CABD
    BADC
    BCDA
    BDCA
    Total Number of Anagrams = 24

  • Write a Program in Java to check for anagrams
  • Anagrams Generator in Java
Also See:   Program to check Upper Triangular matrix

Check Also

Program for Matrix Multiplication in JAVA

Matrix Multiplication:– Here is given a Java Program for Matrix Multiplication also call matrix product. In ...

Leave a Reply

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

Preventing spam * Time limit is exhausted. Please reload the CAPTCHA.