Answer Posted / amit patel
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()
| Is This Answer Correct ? | 14 Yes | 1 No |
Post New Answer View All Answers
What are white spaces in java?
What is the benefit of lambda expressions?
How many ways can an argument be passed to a subroutine and explain them?
hr interview how many minutes asking question
How do you sort in descending order in java using collections sort?
What is the use of callablestatement?
Is it possible to compare various strings with the help of == operator?
Can we have more than one package statement in the source file?
What is visibility mode?
What is the importance of hashcode() and equals() methods?
Can a static block throw exception?
What is nested class?
What is string immutability?
Can you explain the private protected field modifier?
Can we override data members in java?