/**
* practice
*/
public class Practice {
public int[] myArray = {1,2,3,4,5,6};
public void sumAndProduct(int [] arr){
int sum = 0;
int product = 1;
for(int i = 0; i < myArray.length; i++){
sum += myArray[i];
product *= myArray[i];
}
System.out.println("The sum is: " + sum);
System.out.println("The product is: " + product);
}
public static void main(String[] args) {
Practice demo = new Practice();
demo.sumAndProduct(myArray);
}
}