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...

Can we have a non static member function in a base class to
be override in derived with static modifier?

Answer Posted / srinivas

yes we can have a nonstatic membe function in the base ,
which can be override in derived class with static modiier.

for ex:
class sample
{
public:
static void get(){cout<<"this is base class
function:"<<endl;}
static void put(){cout<<"this is a put function of
base class :"<<endl;}
};
class sample1:public sample
{
public:
void put(){cout<<"this is a derived class
function:"<<endl;}
};
sample class is havinfg a non static member function put
which is overidden in dervied which static key word.

Which runs fine.

Is This Answer Correct ?    1 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is meant by console programming?

973


What are value types in c#?

952


What is global namespace in c#?

1012


What is generic and non generic collections in c#?

882


How do you name a variable in c#?

965


Is c# an array?

963


What is querystring in c#?

969


What is sqlcommandbuilder c#?

991


What is type class in c#?

1091


In the page load event I assigned dropdownlist’s datasource property to a valid list. On the submit button click.. The same datasource property is coming as null. Why?

911


What do you mean by for each loop?

962


What is the benefit of interface in c#?

1004


Why are dynamic link library used over static one?

1020


What is data hiding in c#?

951


Why we use get set property in c#?

986