```
class Solution {
public int findMaxConsecutiveOnes(int[] nums) {
int maxCount = 0;
int count = 0;
for (int i : nums) {
if (i == 1) {
count++;
} else {
maxCount = Math.max(count, maxCount);
count = 0;
}
}
return Math.max(count, maxCount);
}
}
```