Question
(JAVA) We have a partially defined PhonePlan class, as shown below, where users can create phone plans by specifying the freeMinutes and freeMessages . Complete
(JAVA)
We have a partially defined PhonePlan class, as shown below, where users can create phone plans by specifying the freeMinutes and freeMessages. Complete the following code to meet the constructor requirements of the client class. To complete the code, create an overloaded constructor that takes in arguments used to set values of freeMinutes and freeMessage. The sample client code is provided below. The overloaded constructor should satisfy the creation of object userPlan2 ,as shown in the class CallPhonePlan.
write the overloaded constructor
1 11 Code from file PhonePlan.java 2 public class PhonePlan 2 private int freeMinutes; private int freeMessages; 6 public PhonePlan() freeMinutes =0; freeMessages = 0; 10 12 / FIXME: Create a second constructor with numMinutes and numMessages parameters 13 14 Your solution goes here/ 15 16 public void print) 17 18 19 20 21 11 2 9 ", Messages: " freeMessages); System.out.println("Minutes: "freeMinutes return
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started