easy java solution

```
public class Solution {
public int findMaxConsecutiveOnes(int[] nums) {
int max = 0;
int index = -1;
int len = nums.length;
for(int i=0; i<len; i++){
if(nums[i] == 1)
max = (max>(i - index))?max:(i - index);
else
index = i;
}
return max;
}
}
```