In which Scenario you will go for Interface or Abstract Class?
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 |
1234554321 1234 4321 123 321 12 21 1 1 12 21 123 321 1234 4321 1234554321
What are objects in oop?
What is encapsulation example?
write a program in c++ to overload the function add (s1,s2) where s1 and s2 are integers and floating point values.
What is abstraction in oops with example?
what is diff between .net 1.1 and .net 2.0
What is interface? When and where is it used?
what is graphics
Difference between new operator and operator new
What is difference between new and malloc?
What is a mixin class?
what is the use of template classes in c++