Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

What is Virtual Keyword?

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


Please Help Members By Posting Answers For Below Questions

How can you overcome the diamond problem in inheritance?

1184


What is polymorphism what is it for and how is it used?

1023


What is inheritance in simple words?

1058


Why is oop useful?

1117


What is the diamond problem in inheritance?

1143


Why do we use class?

1097


What is encapsulation and abstraction? How are they implemented in C++?

1140


What is for loop and its syntax?

1088


class type to basic type conversion

2421


explain sub-type and sub class? atleast u have differ it into 4 points?

2317


Hi friends I have experience of 6 months in website design and maintanence. Now i am looking for other IT jobs.. to switch platform. please post any interview you know in chennai.

2198


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.

1244


Which language is pure oop?

1022


What is a class in oop?

1137


What are functions in oop?

1061