In which Scenario you will go for Interface or Abstract Class?
Answer Posted / swetcha
Interfaces, like classes, define a set of properties,
methods, and events. But unlike classes, interfaces do not
provide implementation. They are implemented by classes,
and defined as separate entities from classes. Even though
class inheritance allows your classes to inherit
implementation from a base class, it also forces you to
make most of your design decisions when the class is first
published.
Abstract classes are useful when creating components
because they allow you specify an invariant level of
functionality in some methods, but leave the implementation
of other methods until a specific implementation of that
class is needed. They also version well, because if
additional functionality is needed in derived classes, it
can be added to the base class without breaking code.
| Is This Answer Correct ? | 12 Yes | 2 No |
Post New Answer View All Answers
any one please tell me the purpose of operator overloading
How is polymorphism achieved?
What is overriding in oop?
I have One image (means a group photo ) how to split the faces only from the image?............ please send the answer nagadurgaraju@gmail.com thanks in advace...
What is the oops and benefits of oops programming?
What are the 4 main oop principles?
What are constructors in oop?
What is abstraction encapsulation?
What is for loop and its syntax?
Which method cannot be overridden?
What is the benefit of oop?
What is polymorphism and example?
What is a class oop?
What is meant by oops concept?
What are the 5 oop principles?