I need to test the values of an array to other values in the array in java
<p>IN the case I need to set up two columns of data that comes from an array </p>

<pre><code>int array = new int[Amount];

int input = scan.nextInt();

for(int i = 0; i&lt;Amount;i++){
array[i]= input;
}
</code></pre>

<p>Now I'm thinking for loop with print function. </p>

<pre><code>for(int b=0;b&lt;Amount;b++){
</code></pre>

<p>I need to print out the numbers(values) of the array and how many times each value was inputted. I have no idea how to see if an value equals the other value. I need to set up a counter and also remove the repeated values from the printed column. 
It might and easy fix, sorry if it is. </p>

<p>My entire code</p>

<pre><code>import java.util.Scanner;

public class DisplayPut{
  public static void main(String[]args){

    Scanner scan = new Scanner(System.in);
    System.out.println("How many numbers would you like to enter?");

    int Amount = scan.nextInt();

    System.out.println("Enter the values you need to store between 0 and 50.");

    int i;
    int array[] = new int[Amount];

    for(i=0; i&lt;Amount;i++){
      int input = scan.nextInt();
      if (input&gt;50){
        System.out.println("DO NOT ENTER NUMBERS OVER 50.");
        i=i-1;}
      else if (i&lt;51){      
      array[i] = input;
      }
      else{
        System.out.println("You broke the program you must now restart.");
      }
    }
    for(int b = 0; b&lt;Amount; b++){

      int counter=0;
      if(array == input2){
        counter++;
        System.out.println(counter +"\t"+ array[b]);}
else{
  System.out.println("You have: " + counter+"\t" + " of: "+ array[b]);}
}}}
</code></pre>
