title: return non duplicates numbers in array from method
body: <p>I am trying to remove duplicate numbers using method and return non-duplicate numbers, actually I am stuck in method right now.
  this is my code :</p>
  
  <pre><code>import javax.swing.JOptionPane;
  public class duplicateRemover{
       public static void main(String[] args) {
      int[] array = new int[5];
  
      for (int i=0; i&lt;array.length;i++) {
        String s=JOptionPane.showInputDialog(null,"PLEASE ENTER AN INTEGER:","INTEGERS",JOptionPane.QUESTION_MESSAGE);
        array[i] = Integer.parseInt(s);
  
      }
      removeDuplicates(array);
     for (int i=0; i&lt;array.length;i++) {
      JOptionPane.showMessageDialog(null,array[i],"UNIQE INTEGERS",JOptionPane.PLAIN_MESSAGE);
     }
       }
  public static int[] removeDuplicates(int a []) {
     int []removedDup=new int[a.length];
  
    for (int i = 0; i &lt; a.length; i++) {
      for (int j = i-1; j &lt; a.length; j++){
        if (a[i] == a[i]) {
          removedDup[i] = j;
          break;
  
    }
  
   }
  </code></pre>