Question 1 of 10
The Hopper class is supplied. What text does this caller display?
class Hopper {
private int grain;
public Hopper() {
grain = 12;
}
public void pour(int n) {
grain += n;
}
public int amount() {
return grain;
}
}
Hopper bin = new Hopper();
bin.pour(5);
System.out.print(bin.amount());
- A. 5
- B. 12
- C. 17
- D. 0