Question 1 of 5
A lantern constructor is unfinished.
class Lantern {
private int oil;
public Lantern(int oil) {
/* missing assignment */
}
public int level() {
return this.oil;
}
}
(a) Write the constructor assignment that stores the parameter in the instance variable. (b) When new Lantern(7) runs, what object does this refer to? (c) After Lantern lamp = new Lantern(7); what does System.out.print(lamp.level()); display?