2
Answers

oops overriding

Sinu  Joseph

Sinu Joseph

11y
1.3k
1
create a base class, telephone and derive a class electronicphone from it.in telephone,create a protected string member phonetype,and a public method ring() that outputs a text message like this:"ringing the <phonetype>:. in electronmicphone the constructor should set the phonetype to "digital" in the run () method , call ring() on the electronicphone to test the inheritance

a) the derived class override the ring() method to display a different message

b) change the telephone class to abstract and make ring() an abstract method . derive two new classes from telephone : digitalphone and talkingphone. each derived class should set the phonetype and override the ring() method.
Answers (2)