A static member cannot be marked as override, virtual, or abstract.
Take this example
class Base
{
public static virtual void fun()
{
Console.WriteLine("Base");
}
}
class child : Base
{
public override void fun() //error: Static methods never be override
{
Console.WriteLine("child");
}
}
Take this example
class Base
{
public static virtual void fun()
{
Console.WriteLine("Base");
}
}
class child : Base
{
public override void fun() //error: Static methods never be override
{
Console.WriteLine("child");
}
}
No comments:
Post a Comment