Question { 11690 }
what is main purpose of abstract class?
Answer
Abstract class is used to implement common behavior which is
required by all subclasses but have some behavior which is
specific to subclass.
E.g., you want to implement a DocumentViewer App. Basic
operations are like open, view and close. open and close
requires no specific implementation while view require
specific implementation. Make DocumentViewer abstract,
implement open, close and make view as abstract. Now view is
responsibility of subclass. Like PDFViewer will have own
implementation for view()