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 array and arraylist?

976


What is the difference between Object and class adapters?

929


Helo , Help Me , Help Me About : C# Windows Application - Network How To Manage IP Client's Accessiblity To The Internet Share concise Substitute , Minor ISA Server

1923


What is jagged array in c#?

1054


Is datetime value type c#?

834


What is assembly manifest?

980


When a Static Constructor is called in a Class?

1004


What is difference between private and static constructor?

888


What is the use of xmlserializer?

829


Why are mutable structs evil?

924


How do I link two windows forms in c#?

897


Which namespace is required to implement trace ?

931


What are the different ways of method can be overloaded?

849


Can constructor be protected in c#?

903


What is the default scope of a class in c#?

911