/** * The main method. * * @param args the arguments */ public static void main(String[] args) { int n; if (args.length != 1) { System.out.println("Incorrect usage. Exiting..."); printCorrectUsage(); System.exit(1); } try { n = Integer.parseInt(args[0]); SieveOfEratosthenes sieve = new SieveOfEratosthenes(n); sieve.printPrimes(); } catch (NumberFormatException nfe) { System.out.println(args[0] + " is not a number. Exiting..."); printCorrectUsage(); System.exit(1); } }