Java Program to sum all the elements in an array.

Output: