Array Count Method In Java