javaprograms

Ads
 

javaprograms

please help in this java program.... 2345 1345 1245 1235 1234

View Answers

August 30, 2011 at 12:28 PM

public class UniqueCombinations {
    public static void find(String s) { find("", s); }
    private static void find(String prefix, String s) {
        if(prefix.length()==4){
        System.out.println(prefix);
        }
        for (int i = 0; i < s.length(); i++)
            find(prefix + s.charAt(i), s.substring(i + 1));

    }  
    public static void main(String[] args) {
       String st = "12345";
       find(st);
       System.out.println();
      }
}

Ads









Related Tutorials/Questions & Answers:
javaprograms
javaprograms
Advertisements
javaprograms
javaprograms
javaprograms
javaprograms
javaprograms
javaprograms
javaprograms
javaprograms
javaprograms
javaprograms
javaprograms
javaprograms
javaprograms
javaprograms
javaprograms
javaprograms
javaprograms
javaprograms
javaprograms
javaprograms
javaprograms
javaprograms
javaprograms
javaprograms
javaprograms
javaprograms
javaprograms
javaprograms
javaprograms

Ads