A
Aamir Mahmood
Hi all,
I have a question. Can static members (methods and nested types) be made
virtual in a class? So that they can be overridden in the child classes.
For example:
-------------------
public class Parent {
public enum AllowedColors = {Red, Blue, Green}
public static void DoSomething() {
}
}
public class Child : Parent{
public new enum AllowedColors = {Black, Blue, Yellow}
public new static void DoSomething() {
}
}
-------------------
Is it allowed in Csharp?
Regards,
-
Aamir
I have a question. Can static members (methods and nested types) be made
virtual in a class? So that they can be overridden in the child classes.
For example:
-------------------
public class Parent {
public enum AllowedColors = {Red, Blue, Green}
public static void DoSomething() {
}
}
public class Child : Parent{
public new enum AllowedColors = {Black, Blue, Yellow}
public new static void DoSomething() {
}
}
-------------------
Is it allowed in Csharp?
Regards,
-
Aamir