Can someone provide me the solution of Sum or Product in Java? I am not getting what is wrong?

Can someone please help me to get the solution to this question?
https://www.codingninjas.com/codestudio/problems/sum-or-product_920478