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