Java Programming For Developing Anagrams


An anagram is a rearrangement of the letters of a word or phrase into a new word or phrase. Some of them can be quite amusing or apt. For example:
·    ok state cowboy = wacky toe boots
·    live orange = regain love
·    video games = gives a demo
·    dr dave cline = devil dancer, evil cad nerd

1.    Write a console application that prints out a list of all the anagrams from a phrase, with one anagram on each line.
2.    Two pieces of input are required, (1) the dictionary file, and (2) the word or phrase to be rearranged. Your program needs to be able to use different dictionary files and query phrases based on keyboard input, either as command line arguments or as prompted by the program.
3.    Create all of the anagrams from the input phrase, and print them out, one per line. Only generate each anagram once.
4.    Generate the anagrams in order in terms of number of words. That is, generate all anagrams with 1 word, then all with 2 words, then all with 3, and so forth.
5.    Test out your program on a number of phrases to find some good anagrams.
6.    Optional: be able to exclude certain words, or demand that some words be part of the anagram.

Question checklist:
·    Write a console program to generate anagrams.
·    Let the user input both the dictionary file name, as well as a phrase.
·    Generate anagrams in order from smallest to largest number of words.
·    Come up with some good anagrams and write them down to share with the class.
·    Make sure the programs compile and run from the command line without modification.


The question belongs to Computer Science and it discusses about writing a Java program which can develop anagrams by using the dictionary file attached.

Total Word Count NA

Download Full Solution


  • HWA

    this is a very good website

  • HWA

    I have 50 questions for the same test your page is showing only 28

  • HWA

    hi can you please help or guide me to answer my assignments. thanks

  • HWA

    hi can anyone help or guide me to my assignments. thanks

  • HWA

  • HWA

    This solution is perfect ...thanks

  • HWA

    Hello Allison,I love the 2nd image that you did! I also, had never heard of SumoPaint, is something that I will have to exolpre a bit! I understand completely the 52 (or so) youtube videos that you probably watched. Sometimes they have what you want, sometimes they don't! However, it is always satisfying when you are able to produce something that you have taught yourself. Great job!Debra 0 likes

  • HWA

    Perfect bank of solution. 

  • HWA

    great !

  • HWA
    Paul Brandon-Fritzius

    thanks for the quick response. the solution looks good. :)

  • HWA
    tina Johnson

    thnx for the answer. it was perfect. just the way i wanted it. 

  • HWA

    works fine.