Question: Consider a class Cheese which extends a class named Snack. The compiler adds an implicit call to the no - argument constructor of the super

Consider a class Cheese which extends a class named Snack. The compiler adds an implicit call to the no-argument constructor of the super class to which of the following constructors of the class Cheese?
1) public Cheese(){
super. setFlavor"smoky");
this.daysUntilExpiry =19;
}
2) public Cheese(String name, int daysUntilExpiry){
super(name, daysUntilExpiry);
this.numServings =19;
}
3) public Cheese(String daysUntilExpiry){
this("smoky", daysUntilExpiry);
this.numServings =19;
}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!