Can we have a private virtual method ?
Answer Posted / nk
We can have virtual functions as long as we dont call the
function from a base pointer pointing to the base
class/derived class.
If we call then gives error.
The same error can be tested by compiling and running above
example.
| Is This Answer Correct ? | 3 Yes | 2 No |
Post New Answer View All Answers
What is the problem with multiple inheritance?
design a c++ class for the chess board,provide a c++ class definition for such class(only class definition is required)
Question: Implement a base class Appointment and derived classes Onetime, Daily, Weekly, and Monthly. An appointment has a description (for example, “see the dentist”) and a date and time. Write a virtual function occurs_on(int year, int month, int day) that checks whether the appointment occurs on that date. For example, for a monthly appointment, you must check whether the day of the month matches. Then fill a vector of Appointment* with a mixture of appointments. Have the user enter a date and print out all appointments that happen on that date.
to find out the minimum of two integer number of two different classes using friend function
What is the example of polymorphism?
hi, this is raju,iam studying b.tech 2nd year,iam want know about group1 and group2 details, and we can studying without going to any instutions? please help me.
Why multiple inheritance is not possible?
What is the difference between inheritance and polymorphism?
What is debug class?what is trace class? What differences are between them? With examples.
What is Difeerence between List obj=new ArrayList(); and ArrayList obj=new ArrayList()?
What is abstract class in oop?
How do you answer polymorphism?
What are the types of abstraction?
Why we use classes in oop?
What is the point of oop?