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

Is learning c# hard?

510


What are escape sequences explain with example?

483


Define strong name in c#?

523


What is int16?

513


Can we inherit sealed class in c#?

471






What is arraylist class in c#?

532


How does return work in c#?

508


Is list ienumerable c#?

608


Why use a singleton instead of static methods?

463


What is xml document how do you open it?

572


Why do we overload constructors?

493


Is a c# interface the same as a c++ abstract class?

563


What is strong name assembly?

461


What is an assembly qualified name? Is it a filename? How is it different?

498


What are the 3 elements of delegation?

497