开发者

how are static class instantiated

开发者 https://www.devze.com 2023-03-03 22:05 出处:网络
I want to know how are static class Instantiated. I mean according to OOPS concepts no class can be used without instantiating it. But still we can use static classes without instantiating it, so when

I want to know how are static class Instantiated. I mean according to OOPS concepts no class can be used without instantiating it. But still we can use static classes without instantiating it, so when and how does static classes get instantiated.

Edited-------

Also I am confuse about the constructor calls when I am inheriting an abstract class and I make a instance of child class. can anyone explain me that also.

Thanks in Adv开发者_StackOverflowance.


The mechanism will vary from framework to framework, but in the .Net world, the static constructor is called when the type is initialised -- it is key to remember that the developer has no direct control over when the constructor is called, so it would be dangerous to rely on a particular implementation in a particular version of the framework.

0

精彩评论

暂无评论...
验证码 换一张
取 消