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 method is used to sort the elements of the array in descending order?

900


What is global asax in c#?

884


Explain get and set accessor properties?

845


What is javascriptserializer c#?

936


What is a namespace server?

860


What is system predicate?

831


What is executereader in c#?

856


What is default method in c#?

956


What does dbml stand for?

950


Is xml tags are case sensitive?

833


What is virtual class in C#?

942


How to declares a two-dimensional array in C#?

979


What is the root element of an xml file?

822


What is the difference between iqueryable and ienumerable?

892


What is string in c# net?

873