find the item is last in the array index code example Example: how to find last element in array int [] y={1,2,3,4,5}; int c=(n.length-1);