public class Test13 
{ 
    public static String str = "abc"; 
    public static void main(String[] args) 
    { 
        Shuffle(0, new String("")); 
    } 
    public static void Shuffle(int current_recur, String temp) 
    { 
        if(current_recur < str.length()) 
        { 
            for(int i = 0; i < str.length(); i++) 
            { 
                if( ! ( temp.contains(str.substring(i, i + 1)) ) ) 
                { 
                    System.out.println(temp + str.substring(i, i + 1)); 
                    Shuffle(current_recur + 1, new String(temp + str.substring(i, i + 1))); 
                } 
            } 
        } 
    } 
} 
 |