Counting how many times a value appears in an array follows the same scan pattern. You initialize a counter at and increment it each time you find a match:
int[] rolls = {3, 5, 3, 2, 3, 6, 1, 3};
int target = 3;
int count = 0;
for (int roll : rolls) {
if (roll == target) {
count++;
}
}
System.out.println(count); // 4
For String arrays, remember to use .equals() instead of ==. Using == on strings compares references, not content. That bug will give you a count of even when the string appears multiple times.