when to use abstract class and when to use interface?
Answer Posted / mohit jethva
In Interfate you are restricting a user to impement each
and every method of interface so if you have a requirement
which is constantly changing so don't prefere interface.
While in Abstract Class user don't need to implement each
and every method which is not required or marked with
mustoverride.
And by using interface you can achive multiple inheritance
in C# but with Abstact class it's can't be achive
Is This Answer Correct ? | 31 Yes | 21 No |
Post New Answer View All Answers
What is the best way to findout the time/memory consuming process?
Explain the JDB in depth & command line.
Describe how to implement singleton design pattern in struts.
What are latest features introduced with java 8?
What is stack example?
Which variables are stored in heap?
what is abstract class in Java?
Can you run java program without main method?
What is the impact of declaring a method as final?
Do I need java for windows 10?
What are the two types of java?
What is boolean logic?
What is vector capacity in java?
How many bits is a float?
How to use string tokenizer class.