public static boolean allPositive(int[] a) {
/* missing */
for (int x : a) {
if (x <= 0) return false;
}
return true;
}Which initialization, if any, is needed for /* missing */?
- A
return true;
- B
boolean result = true;
- C
int count = 0;
- Dcheck_circle
Nothing is needed; the line can be removed
Explanation
The method correctly returns false on first non-positive and true otherwise; no extra variable is needed before the loop.