1Java provides several arithmetic operations that you can use in your programs.
2 In order to multiply numbers in Java, we will use the asterisk (*) between each number or variable
1public class SumOfElements {
2
3 public static void main(String[] args){
4
5 int[] a = {1,2,3,4,5};
6
7
8 int sum = sumArray(a);
9
10 int result = multiply(5,10);
11 }
12
13 private static int multiply(int i , int j) {
14
15 int k = 1;
16 int sum = 0;
17
18 while(k <= j)
19 {
20 sum = sum + i;
21 k++;
22 }
23
24