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 10:46

>>9
Holy shit, in my CSII class we had to build a table of processing times of different sorting algorithms using Java.

When our professor realized that all of his students were coming up with the same time for each sorting algorithm (due to Java's terrible overhead) he immediately switched all coursework requirements to C.

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