Question: Java program After learning about Inheritance, you try to test your understanding by building a Phone class that will represent phones and a class that
After learning about Inheritance, you try to test your understanding by building a Phone class that will represent phones and a class that inherits from this class called SmartPhone which represents phones that have access to World Wide Web. The Phone class will have one instance variable to represent the model of the phone. SmartPhone will inherit from the Phone class and will have one instance variable that stores the web address of the page that the phone is currently on. Each class should be built using object- oriented methodology by making its instance variables private and developing public methods to access and mutate the instance variables of each class. The public methods of Phone will be inherited by SmartPhone and should not be duplicated in the SmartPhone class. These classes do not need to override any methods from the Object class. After developing these two classes, build a demo class that creates an object of the Phone class and an object of the SmartPhone class. The program should give the user five options. The first option will allow the user to enter the information about their phone. The second option will allow the user to enter the information about their smart phone. The third option will allow the user to look at or review the information about their phone. The fourth option will allow the user to look at or review the information about their smart phone. The fifth option should end the program. If any other option is selected the user should be given an error message and given another chance to choose of one of the options
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
