If I try to declare static and non-static methods with the same parameters, the compiler returns an error: type 'Test' already defines a member named "Load" with the same parameters.
class Test { int i = 0; public int I { get { return i; } set { i = value; } } public bool Load(int newValue) { i = newValue; return true; } public static Test Load(int newValue) { Test t = new Test(); tI = newValue; return t; }
As far as I know, these two methods cannot be mixed, the non-static method is called on the object, while the static method is called on the class, so why doesn't the compiler allow something like this, and is there a way to do something like that?
source share