public static void doanagram(int newsizeif(newsize = /if too smallreturn/go no further for(int = <newsizej++/for each positiondoanagram(newsize- )/anagram remaining if(newsize== /if innermostdisplayword()/display it rotate(newsize)/rotate word each time the doanagram(method calls itselfthe size of the word is one letter smallerand the starting position is one cell further to the rightas shown in figure newsize position level level level level figure newsize position newsize position newsize position smaller and smaller words listing shows the complete anagram java program the main(routine gets word from the userinserts it into character array so it can be dealt with convenientlyand then calls doanagram(listing the anagram java program /anagram java /creates anagrams /to run this programc>java anagramapp import java io *///////////////////////////////////////////////////////////////class anagramapp