I am trying to find all permutations of a pin number coming from a scanner. I have got this bit so far which I guess sets an array with custom digits. How can I get this code to show me all the possible options? Bare in mind that I am new to Java so simple explanations would be the best. Thanks
import java.util.Arrays;
import java.util.Scanner;
public class Methods {
public static void main(String[] args) {
// TODO Auto-generated method stub
int[] arr = new int[3];
Scanner sc = new Scanner(System.in);
System.out.println("Please enter first digit: ");
arr[0] = sc.nextInt();
System.out.println("Please enter second digit: ");
arr[1] = sc.nextInt();
System.out.println("Please enter third digit: ");
arr[2] = sc.nextInt();
System.out.println("Please enter fourth digit: ");
arr[3] = sc.nextInt();
System.out.println(Arrays.toString(arr));
}
}