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

Answer Posted / siva

No We cannot Create. It shows an error.

A static member 'Analysis.Class3.ss1()' cannot be marked as
override, virtual, or abstract

class Class2
{
public Class2()
{
}
public virtual void ss1()
{
System.Windows.Forms.MessageBox.Show("Base :
ss1");
}
}
class Class3:Class2
{
public Class3()
{
}
public static override void ss1()
{
System.Windows.Forms.MessageBox.Show
("Derived:s1");

}

}

Is This Answer Correct ?    2 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is public or shared assemblies ?

764


What is jit (just in time)?

734


What does int32 mean in c#?

650


What is expression c#?

691


What are the advantages of clr procedure over t-sql procedure?

783


How many dimensions can an array have?

645


Which is better javascript or c#?

676


Explain the types of Polymorphism.

779


Why do I get an error (cs1006) when trying to declare a method without specifying a return type?

709


What is the purpose of namespace?

636


What is the use of jit ? Jit (just - in - time) is a compiler which converts msil code to

718


What are immutable types in c#?

675


Why do we use generics in c#?

738


Is a decimal an integer?

662


What is AutoMapper in C#?

762