I am trying to make a counter with a list of 10 elements in random position, the problem is that after making the complete tour of my array I must print on the screen how many numbers that are repeated.
To do this, I made the method out of my Main space, I declared the array and the "for loop" to tour my array, the question is after that I must will include in the same method the counter ? ...
public static int Vectores(int a[]) {
// Declared variable
a = new int[10];
int lf = a.length;
// Here we will tour the array and then complete the arrays with random numbers.
for (int i = 0; i < lf; i++) {
a[i] = (int) (Math.random() * 100);
System.out.println(" A:" + a[i] );
}
return a[i];
// Here will be an "if condition" + and for loop to the counter
int counter = 0;
for (int i = 0; i < 10; i++) {
}
} // END