The world’s Largest Sharp Brain Virtual Experts Marketplace Just a click Away
Levels Tought:
Elementary,Middle School,High School,College,University,PHD
| Teaching Since: | Apr 2017 |
| Last Sign in: | 103 Weeks Ago, 3 Days Ago |
| Questions Answered: | 4870 |
| Tutorials Posted: | 4863 |
MBA IT, Mater in Science and Technology
Devry
Jul-1996 - Jul-2000
Professor
Devry University
Mar-2010 - Oct-2016
Define the missing method. Use "this" to distinguish the local member from the parameter name.
Â
Â
// ===== Code from file CablePlan.java =====
public class CablePlan {
  private int numDays;
Â
  // FIXME: Define setNumDays() method, using "this" implicit parameter.
  public void setNumDays(int numDays) {
Â
     /* Your solution goes here */
Â
     return;
  }
Â
  public int getNumDays() {
     return numDays;
  }
}
// ===== end =====
Â
// ===== Code from file CallCablePlan.java =====
public class CallCablePlan {
  public static void main (String [] args) {
     CablePlan house1Plan = new CablePlan();
Â
     house1Plan.setNumDays(30);
     System.out.println(house1Plan.getNumDays());
Â
     return;
  }
}
// ===== end =====
-----------