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
Is there a case when finally will not execute?
What is an enumeration?
What is integer size in java?
Is null a keyword in java?
Can a variable be local and static at the same time?
Explain what pure virtual function is?
What is the functionality of the stub?
Explain the difference between collection api and stream api in java8?
Is array primitive data type in java?
How many java versions are there?
Why we go for collections in java?
What are thread priorities and importance of thread priorities in java?
Why can't we use static class instead of singleton?
what is method reference in java 8?
Hi i am creating desktop application in that i want calling to mobile number. i have java telephone api (JTAPI) but i dont understand how it configure & use plese help me