count of an element in a java array code example Example: java count elements in array int count = arr.length;