title: Print only non repeated elements in an array?
body: <p>Here is my code snippet</p>
  
  <pre><code>import java.util.*;
  public class UniqueEl
  {
      public static void main(String []p)
      {
          Scanner sc=new Scanner(System.in);
          System.out.println("Enter Array size");
          int size=sc.nextInt();
          //boolean ischeck=true;
          int flag=0,cnt=0;
          int []num=new int[size];
          System.out.println("Enter Array Elements");
          for(int i=0;i&lt;size;i++)
          {
              num[i]=sc.nextInt();
          }
          System.out.println("Display Array Elements");
          for(int i=0;i&lt;size;i++)
          {
              System.out.println("Array Elements are :-"+num[i]);
          }
          System.out.println("Unique elements from the array ");
          for(int i=0;i&lt;size;i++)
          {   
              for(int j=0;j&lt;size;j++)
              {
                  if(i!=j)
                  {
                      if(num[i]=num[j])
                      {
                          flag=1;
                      }
                      else
                      {
                          flag=0;
                          break;
                      }
  
                  }
              }
              if(flag==1)
              {
                  cnt++;
              System.out.println(num[i]+" ");
  
              }
          }
      }
  }
  </code></pre>
  
  <p>Here In this array code I have to print non-repeated integer value </p>
  
  <p>Say Array value is :-[1,1,2,3,1,2,4,5]
      answer should be :-[3,4,5]
      that is non repeated integer value I have to print .Can any one help me to solve this problem</p>