Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Quick Question

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?

Name: Anonymous 2009-11-03 16:12

>>26
s/LISP/Lisp/
It's not the 1970's anymore

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List