Answer Posted / danish afzal
Virtual is important part of polymorphism,and if a function of a base class is virtual we can use or override it in drived classes.
class base
{
virtual void foo() const
{
cout << "danish B";
}
};
class derived1 :public base
{
void foo() const
{
cout << "danish D1";
}
};
class derived2 :public base
{
void foo() const
{
cout << "danish D2";
}
};
| Is This Answer Correct ? | 4 Yes | 1 No |
Post New Answer View All Answers
What is multilevel inheritance explain with example?
is there any choice in opting subjects like 4 out of 7
what type of questions
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.
Why is static class not inherited?
assume the program must insert 4 elements from the key board and then do the following programs.sequential search(search one of the elements),using insertion sort(sort the element) and using selection sort(sort the element).
What is object in oop with example?
What are the benefits of interface?
What type of loop is a for loop?
Templates mean
What is overloading in oops?
What is oops?what is its use in software engineering?
Explain the concepts involved in Object Oriented programming.
Is this job good for future? can do this job post grduate student?
What is use of overloading?