Question: In SmartPhone, make a constructor that accepts the name and phone number. Save name and phone data in the superclass. Test Case 1 Name: Allan
In SmartPhone, make a constructor that accepts the name and phone number. Save name and phone data in the superclass.
Test Case
Name: Allan Hancock College Phone:
Name: InNOut Burger Phone:
Name: Costco Wholesale Phone: public class Phone
protected String name;
protected long number;
public PhoneString name, long number
this.name name;
this.number number;
public String toString
return "I am a phone!";
public class Demo
public static void mainString args
Phone p new SmartPhoneAllan Hancock College", L;
Phone p new SmartPhoneInNOut Burger", L;
Phone p new SmartPhoneCostco Wholesale", L;
System.out.printlnp;
System.out.printlnp;
System.out.printlnp;
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
