public static void main(String[] args) throws Exception { int n = 8; int num = 0; int print = 1; if (args.length > 0) { n = Integer.parseInt(args[0]); } if (args.length > 1) { num = Integer.parseInt(args[1]); } if (args.length > 2) { print = Integer.parseInt(args[2]); } NQueens.solve(n, num, print); }