Not sure why the continue statement is not working any help is appreciated
package com.codegym.task.task08.task0812;
import java.io.*;
import java.util.ArrayList;
/*
Longest sequence
*/
public class Solution {
public static void main (String [] args) throws Exception{
BufferedReader bol = new BufferedReader(new InputStreamReader(System.in));
ArrayList <Integer> list = new ArrayList <Integer> ();
for (int x = 0; x < 10; x++) {
list.add(Integer.parseInt(bol.readLine()));
}
System.out.println(Longest(list));
}
public static int Longest(ArrayList<Integer>array) {
int big = 0;
for (int x : array) {
int count = 0;
for (int y : array) {
if(x == y) {
count++;
}else if (x != y) //continue;
if (count > big) big = count;
continue;
}
//if (count > big) big = count;
}
return big;
}
}