I have two classes Class A and ClassB:
static class ClassA { static string SomeMethod() { return "I am a Static Method"; } } class ClassB { static string SomeMethod() { return "I am a Static Method"; } }
I want to know what is the difference between ClassA.SomeMethod(); and ClassB.SomeMethod();
When both can be accessed without instantiating the class, why do we need to create a static class and not just use a non-static class and declare methods as static?
c # oop static static-methods non-static
Vamsi Mar 09 '11 at 5:50 2011-03-09 05:50
source share