.1 When we have a normal class and its methods being used very frequently in a given app, then it would speed up things if we made this class a static class with static methods. This is because there is always a cost incurred in terms of resource usage ( CPU, memory, time) EVERY TIME a normal class is instantiated, whereas for static class its only a ONE-TIME cost when static constructor is FIRST called.
2. The main advantage of Static Classes come when there is a need to use WebMethod or a webservice, so that the application can call the static method without creating an object.
2. The main advantage of Static Classes come when there is a need to use WebMethod or a webservice, so that the application can call the static method without creating an object.
Comments
Post a Comment