Hey, sorry if this is a bit of a basic / stupid question but I'm trying to build a method using the built in java array utilities to find out how many elements of a specific value there are in an array. For example, if the array contained 4,4,4,6 and the argument was 4, I would want it to return 3. I thought I might be able to do it using the binarySearch method but even if I could get it to work it would probably be incredibly clunky and inefficient. I'm hoping there's a built in method for this like the binarySearch or sort ones but if there is one, I cant find it.

