When should we use abtract class and Interface Class?Give
an Example
Answer Posted / pallavi
Use an abstract class when you want to inherit only from the parent
Use an interface when you want to inherit from multiple sources
If the behaviour of base class is default behaviour of all the sub classes the use abstract. If it is not default behaviour for all the classes use interface.
Interface - CAN-DO relationship
abstract class - IS-A relationship
Is This Answer Correct ? | 4 Yes | 2 No |
Post New Answer View All Answers
What is inproc and outproc?
How to add DateTime Control in normal DataGrid Server Control?
Can we use a static function with a non-static variable?
What is role-based security in asp.net?
What is page fragment caching?
What is server side routing?
Which is faster viewbag or viewdata?
What is a session http?
What is viewstate? What does the “enableviewstate” property do?
How do we sort the data from a dataset?
What is the parent class of all web server control?
Why cyclomatic complexity is important?
Which platform does Microsoft .NET use for exchanging data between applications?
Can you change a master page dynamically at runtime? How?
What is the difference between session object and application object?