If current product is equal to the current maximum product then choose the maximum element
else if ( currProd == maxProd ) { maxElement = Math . max ( maxElement , a [ i ] ) ; } } return maxElement ; }