what is a virtual class?

Answer Posted / ritesh parkhi

Virtual class in a part or used to implement Runtime
polymorphism.Through it dynamically we can access a class or
method of that class.With use of Pointer to base class we
can implememt it.We try to access object of any class
without regarding their class.We are passing object address
in this base class pointer to access a particulat method of
a class at runtime.

Is This Answer Correct ?    8 Yes 5 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

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.

962


Can an interface inherit a class?

806


Please send ford technologies placement paper 2 my mail id

1865


What is object in oops?

851


can inline function declare in private part of class?

4015


What is destructor oops?

869


What is abstraction in oop?

875


What is the important feature of inheritance?

881


Can a varargs method be overloaded?

839


What is overloading in oops?

867


What is encapsulation in oops?

782


#include #include #include #include void insert(char *items, int count); int main(void) { char s[255]; printf("Enter a string:"); gets(s); insert(s, strlen(s)); printf("The sorted string is: %s.\n", s); getch(); return 0; } void insert(char *items, int count) { register int a, b; char t; for(a=1; a < count; ++a) { t = items[a]; for(b=a-1; (b >= 0) && (t < items[b]); b--) items[b+1] = items[b]; items[b+1] = t; } } design an algorithm for Insertion Sort

2395


Why can't we have instance(stack) of a class as a member of the same class like eg.Class A{A obj;} as we can have self refential pointer

1923


Get me an image implementation program.

1757


Why do we use encapsulation in oops?

772