Trying to write a method that finds the mode (most frequent occurring integer) of a 10 int array. Having some trouble but this is what i have so far:

void findMostFrequent1(int list[])
{
int count = 0;
int value = -1;
int digits[] = new int[10];

for (int index=0;index<list.length;index++)
{
list[digits[index]]++;
}

for (int index=0;index<10;index++)
{
if (count > digits[index])
{
count = digits[index];
value = index;
}
}
System.out.println(value + " appears " + count + " times ");
}