My code have no error messenges but idk why it does not show anything in the console, i'm new to Java pls help me!!
public class test {
public static void main(String[] args) {
int[] b = {27, 15, 15, 11, 27,27, 15,27, 15,27, 15};
mode(b);
}
public static int mode(int[] array) {
int[] spareArray = new int[101];
for (int i = 0; i < array.length; i++) {
spareArray[array[i]]++;
}
int mode = 101;
int count = 0;
for (int i = 0; i < spareArray.length; i++) {
if (spareArray[i] > count) {
count = spareArray[i];
mode = i;
}
}
return mode;
}
}