What will be ouput as a result of a call to the calculate method?
private int sum = 0;
private int product = 0;
public static final int AMOUNT = 5;
public void output(){
System.out.println("The sum of the numbers from 1 to " + AMOUNT + " is "
+ sum);
System.out.println("The product of the numbers from 1 to " + AMOUNT +
" is " + product);
}
public void calculate(){
int sum = 0;
int product = 1;
for (int i = 1; i <= AMOUNT; i++){
sum = sum + i;
product = product * i;
}
output();
}
There are no hints for this question