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 primary benefit of encapsulation?
What is run time allocation?
What java ide should I use?
What is outofmemoryerror in java?
What are triggers in DB? Explain their types. How do they work?
What is treemap in java?
What is the difference between checked exception and unchecked exception?
Can we assign the reference to this variable?
What are the data types supported by java?
which is advanced deep technology in java launched by the sun microsystem??? The answer is very logical If u need correct answer mail me at priya_gupta@gmail.com
What is the static import?
What is meant by nested loop?
What is a map in java?
What is difference between public static and void?
What is the return type of the main method?