get all words using java

Posted by hussain on Stack Overflow See other posts from Stack Overflow or by hussain
Published on 2010-04-20T07:59:42Z Indexed on 2010/04/20 8:03 UTC
Read the original article Hit count: 271

Filed under:
|

i want to know how to get all word using java

        String first[]={"a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"};

        String second[]={"a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"};

        String ch ="";  

        String total[];


        for(int i = 0;i<26;i++)
        {
            for(int j = 0;j<26;j++)
            {
                ch+=first[i]+first[j];

                System.out.println(ch);

            }
        }  

i get only 576 words only by this program

but the 26! words is 4.03291461 × 1026

how to write the program in java

thanks and advance

© Stack Overflow or respective owner

Related posts about java

Related posts about string