Question: Answer these questions: a) When should abstract classes be used ? Give a general answer and an example. b) Explain when an abstract class cannot
Answer these questions:
a) When should abstract classes be used ? Give a general answer and an example.
b) Explain when an abstract class cannot be used in a Java program and an interface is the only choice.
c) The Section class used in a text editor application includes a text attribute, contains a collection of objects of class Section or its subclasses, and has a method called display that displays the text of this section object and of all other sections referenced in its collection. What design pattern does class Section implement ? Explain.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
