Input: Enter Ten Numbers: 1 2 3 2 1 6 3 4 5 2

Output: The Number of distinct numbers is 6

The distinct numbers are: 1 2 3 6 4 5

So far I have the entire code but right now it only prints out the distinct numbers, not how many distinct numbers there are. Can someone please help me figure out what that part of the code would look like? Thanks in advance! Here is my current code:

public class exer75 { public static void main(String[] args) { java.util.Scanner input = new java.util.Scanner(System.in); //create scanner system System.out.println(""); System.out.print("Enter Ten Numbers: "); //prompt the user to enter 10 numbers int[] values = new int[10]; //create an array to hold the numbers int count = 0; //initalize an integer to count the number of distinct numbers //create two loops to find which numbers are distinct for (int i=0; i<10; i++){ int number = input.nextInt(); boolean distinct = true; for (int j=0; j<count; j++){ if (number == values[j]){ distinct = false; break; } } if (distinct) values[count++] = number; } System.out.println(""); System.out.print("The Distinct Numbers are: "); //print out "The Distinct Numbers are" for (int i=0; i<count; i++){ //create a loop to print out each distinct number System.out.print(values[i]+ " "); } System.out.println(""); //add another print line } }