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
Why are parameters used in functions?
What are drawbacks of singleton class?
What is return data type?
How does arraylist size increase in java?
How to sort an array in java without using sort method?
What will happen if there is a default method conflict as mentioned above and we have specified the same signature method in the base class instead of overriding in the existing class ?
What is functional interface in java?
What is fail first in java?
Write a factorial program using recursion in java?
What one should take care of, while serializing the object?
What are 5 boolean operators?
what is thread? What are the high-level thread states? Or what are the states associated in the thread? : Java thread
hi am an engineering student and my next plan is for ms in either in us or australia i got my passport but i dont know anything bout visa can u give brief idea 1)How to get prepared for visa and 2)How to apply for top universities and 3)How to pay the fee and so on These all are basic questions plz give me a clear idea
What is the reason behind using constructors and destructors?
What an i/o filter in java programming?