```
public int arrayCount9(int[] nums) {
int numnines=0;
for(int n=0;n<nums.length;n++){if(nums[n]==9){numnines++;}}
return numnines;
}
```

or this . . .

```
public int arrayCount9(int[] nums) {
int numnines=0;
int ninetally=0;
for(int n=0;n<nums.length;n++){if (!(nums[n]==9)){nums[n]=0;}}
for(int n =0;n<nums.length;n++){ninetally=ninetally+nums[n];}
return ninetally/9;
}
```

although this would be preferable . . .

```
public int arrayCount9(int[] nums) {
int ninetally=0;
for(int n=0;n<nums.length;n++){ninetally= nums[n]==9?ninetally+9:ninetally ;}
return ninetally/9;
}
```