hello can you help me how can i count the element in array
heres my code
int [] num = new int [10];
int i;
System.out.print("Please input 10 numbers");
for(i=1;i<=10;i++)
{
num[i]= console.nextInt();
System.out.print(" " + num[i]);
}
System.out.print("\n");
System.out.print("The elements are");
for(i=1;i<=10;i++)
{
System.out.print("The elements are: " + num[i]);
}
how can i count the elements in array example if I input this..10 1 1 1 2 2 5 5 5 6
the output should this it will count the elements if how many times this inputed
10= 1
1=3
1= 3
1=3
2=2
2=2
5=3
5=3
5=3
6=1
please help me... hoping for your positive responds...thank you in advance....