title: How do I get Java to output unique integers from a command-line argument?
body: <p>The code below checks to ensure the command-line arguments are integers? However, I need it to  only print each integer in the command line once, regardless of how many times that integer appears in the command line. How do I do that? </p>
  
  <pre><code>public class Unique {
      public static void main(String[] args) {
          for (int i = 0; i&lt;args.length; i++) {
              try {
                  int j = Integer.parseInt(args[i]);
                  System.out.println(j);
              }
              catch (NumberFormatException e) {
                  System.out.println("Your command line argument "+ args[i] +" is a non-integer!");
              }
          }
      }
  }
  </code></pre>