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
What method is used to sort the elements of the array in descending order?
What is global asax in c#?
Explain get and set accessor properties?
What is javascriptserializer c#?
What is a namespace server?
What is system predicate?
What is executereader in c#?
What is default method in c#?
What does dbml stand for?
Is xml tags are case sensitive?
What is virtual class in C#?
How to declares a two-dimensional array in C#?
What is the root element of an xml file?
What is the difference between iqueryable and ienumerable?
What is string in c# net?