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