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
What are the different ways of creating thread?
What is contractor means and methods?
What are the different types of inner classes?
How do you make an arraylist empty in java?
How can you avoid serialization in child class if the base class is implementing the serializable interface?
Can we initialize the final blank variable?
Difference between process and thread?
What is variable and constant explain with example?
What is struts in java?
How will you communicate between two applets?
How do you write a good declaration?
What is string pool in java?
Is java se free?
Which containers use a flowlayout as their default layout in java programming?
How does split work in java?