Name: Anonymous 2009-11-03 2:36
public class MostOftenOccurring{
public static int occursMostOften(int[] a){
int[] b = new int[a.length];
for (int i = 0; i < a.length; i++){
b[i] = CountOccurrences.countOccurrences(a, a[i]);
}
for (int j = 0; j < b.length; j++){
if (Maximum.maximum(b) == b[j]){
return b[j];
}
}
return 666; //I did this to make the compiler happy
}
public static void main(String[] args){
int[] testArray = {1};
System.out.println(occursMostOften(testArray));
}
}Is there any way that return 666; could ever be executed?