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 |
Can a destructor be called directly?
What is difference between pop and oop?
What is polymorphism in oops with example?
What is the difference between procedural programming and oops?
what is new operator in c++
Why many objects can working together? How objects working togetherM I want to see example code.
How is polymorphism achieved?
What is polymorphism and example?
Hi All, I am new to programming and want to know how can i write a code to take input of 2 numbers from user and swap it without using a temp variable?
What is polymorphism oop?
what is abstract class ? when is used in real time ? give a exp
Write a program to compute for numeric grades for a course. The course records are in a file that will serve as the input file. The input file is in exactly the following format: Each line contains a student's first name, then one space, then ten quiz scores all on one line. The quiz scores are in whole number and are separated by one space. Your program will take it input from this file and sends it output to a second file. The data in the output file will be exactly the same as the data in the input file except that there will be one additional number (of type double) at the end of each line. This number will be the average of the student's ten quiz scores. Use at least one function that has file streams as all or some of its arguments.