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

Explain states of a thread in c#?

956


If casting fails what type of exception is thrown?

867


What is the use of ispostback in c#?

857


Explain the difference between .net and c#?

916


What is difference between struct and class in c#?

899


What is datasource c#?

880


How are methods overloaded?

984


Why delegates are safe in c#?

859


What is the benefit of using interface in c#?

982


How do I format in c#?

847


What is dictionary collection in c#?

892


What is different about switch statements in c#?

853


Define sealed classes in c#?

898


What is parsing? How to parse a date time string?

1022


Can a constructor have a return type?

849