What is virtual class and friend class?
Answer Posted / vaibhav panchal
A virtual class is an inner class that can be overridden by
derived classes of the outer class.
eg.
class Base
{
public:
int value
};
class child1 : public Base { };
class child2 : public Base { };
class grandchild : virtual public child1, virtual public
child2
{
public:
grandchild() { value };
};
| Is This Answer Correct ? | 38 Yes | 4 No |
Post New Answer View All Answers
What is pointer in oop?
What is overloading in oop?
What is coupling in oops?
What is oops?what is its use in software engineering?
What is a function in oop?
What are benefits of oop?
Explain virtual inheritance?
What is the difference between procedural programming and oops?
What is the difference between a mixin and inheritance?
When not to use object oriented programming?
What are the features of oop?
Which language is not a true object oriented programming language?
Question: Write a program that prints a paycheck. Ask the program user for the name of the employee, the hourly rate, and the number of hours worked. If the number of hours exceeds 40, the employee is paid “time and a half”, that is, 150 percent of the hourly rate on the hours exceeding 40. Be sure to use stepwi se refine ment and break your solution into several functions. Use the int_name function to print the dollar amount of the check.
Can you explain polymorphism?
What is overriding vs overloading?