Define the missing method. Use “this” to distinguish the local member from the parameter name.

Define the missing method. Use "this" to distinguish the local member from the parameter name.

Answer

// ===== Code from file CablePlan.java =====
public class CablePlan {
private int numDays;
// FIXME: Define setNumDays() method, using "this" implicit parameter.
public void setNumDays(int numDays) {
this.numDays = numDays;
}
public int getNumDays() {
return numDays;
}
}
// ===== end =====
// ===== Code from file CallCablePlan.java =====
import java.util.Scanner;

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Posts