how to count the coourence of a number in an array in java code example Example: java count elements in array int count = arr.length;