anonymous
2009-05-04 11:19:09 UTC
System.out.printf("10 occurs %d times\n", countArray1(nums));
^
1 error
***** in this code *********
System.out.printf("10 occurs %d times\n", countArray1(nums));
//returns how many times a number occurs in the above statements
public static int countArray1(int temp[], int item)
{
int count = 0;
for (int x=0; x
if (temp[10] == item);
else
count = count + 1;
}
return count;
}//countarray1
//i am trying to count how many a numer occurs in a array of 8 numbers. it could be very possible that i don't have all the info needed for you to fix the problem. if so, i'm sorry.