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 / gkp
Abstract class and Interface are the design time decision. As we expect to extend our implementation in future so we need to give space to incorporate new implementation. As we know if some implementation of a method will be common in many classes then that method should be moved to abstract class so the repetition of same code can be avoided. Even though we don't have any abstract method in our abstract class, we can go for a abstract class. Generally in design of java classes, it is designed like, first an interface then an abstract class and then concrete class implementation starts.
| Is This Answer Correct ? | 5 Yes | 1 No |
Post New Answer View All Answers
How to create a fecelet view?
Explain the scope of a variable.
What are the data types supported by java? What is autoboxing and unboxing?
Explain all java features with real time examples
Is 9 a prime number?
What is meant by oops concept in java?
what is recursion in java
What are some characteristics of interference class?
What do you mean by Hash Map and Hash Table?
How can we make copy of a java object?
What are packages in java?
What is the generic class?
Which are the two subclasses under exception class?
What is synchronization and why is it important in java programming?
What is a boolean flag in java?