Eliminating Duplicates in an array : <p>Here is the problem I am working on: "Write a method that returns a new array by eliminating the duplicate values in the array using the following method header:</p>

<p>public static int[] eliminateDuplicates(int[] list)</p>

<p>Write a test program that read in ten integers, invokes the method and displays the result."</p>

<p>Here is the code I have:</p>

<pre><code> public static void main(String[] args) {
      Scanner input = new Scanner(System.in);
      int[] list = new int[10];

      System.out.print("Enter ten numbers:");

      for (int i = 0; i &lt; list.length; i++) {
       list[i] = input.nextInt();
      }

      System.out.print("The distinct numbers are: ");
      for(int i = 0; i &lt; 10; i++){
          if( list[i] != -1){
      System.out.print(eliminateDuplicates(list)); 
          }
      } 
 }
     public static int[] eliminateDuplicates(int[] list) {
         for(int i = 0; i &lt; 10; i++){
             for(int j = i + 1; j &lt; 10; j++){
                if (list[i] == list[j]){
                    list[i]= -1;
                     }
             }  
         }
         return list;        
</code></pre>

<p>}
}</p>

<p>My issue is my output is really strange, this is what I'm getting "[I@55f96302[I@55f96302[I@55f96302[I@55f96302[I@55f96302[I@55f96302[I@55f96302"</p>

<p>Can anyone tell me where I'm going wrong? Or a suggestion of where to start fixing it? I'm still a beginner, so I haven't learned a whole lot (like hashsets or anything).</p>

<p>You have my many thanks         </p>
