How to find sum of even and odd element in the given array using java programming