The question asks for a foreach solution

public static int countEmptyBowls(Bowl[] balls){
int sum=0;
for(Bowl bowl:balls){
if(bowl.getEmpty() == true){
sum++;
}
}
...