There can be a abstract class without abstract methods, but
what is the need to declare a class abstract if it doesn't
contain abstract methods?
Answer Posted / ram
We will get an additional facility in using abstract classes over interfaces is, in abstract class if we add a new method, in its child classes we need not implement those newly added methods as it is non-abstract method and has default implementation in the abstract class definition. But whereas if we add a new method (abstract) in the interface, in all its implemented classes needs to implement this newly added method which leads to many changes which is violating one of the design principle – Open for extension Closed for modification.
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
Why is it called buffering?
What is the use of string and stringbuffer?
How do you identify independent and dependent variables?
What happens if we don’t define serial version uid?
What are packages in java?
What is double word?
What is not thread safe?
What is generics in java interview questions?
What is balanced tree in java?
What is the technique adopted to create an immutable class?
What is a numeric literal?
Explain the difference between map and flatmap stream operation?
What do you mean by thread safe?
What is meant by JVM? Is JVM platform independent or not?
Can you override private or static method in java?