import java.util.Arrays; public class TestArraySort_1 { public static void main(String[] args) { int[] numbs = {1,2,3}; permutation(numbs,0,numbs.length-1); } public static void permutation(int[] numbs,int start,int end){ if(start==end){ System.out.println(Arrays.toString(numbs)); } for(int i=start;i<=end;i++){ swap(numbs,start,i); permutation(numbs,start+1,end); swap(numbs,start,i); } } public static void swap(int[] numbs,int start,int i){ int temp = numbs[start]; numbs[start] = numbs[i]; numbs[i] = temp; } }