Re: Override static derived variable
- From: "Chad Z. Hower aka Kudzu" <cpub@xxxxxxxxx>
- Date: Sun, 19 Jun 2005 19:39:36 +0300
Jon Skeet [C# MVP] <skeet@xxxxxxxxx> wrote in
news:MPG.1d1faede6caac18298c351@xxxxxxxxxxxxxxxxxxxx:
> Those both compile to the same thing - there will be nothing which
> actually references Derived.GetVar in the IL, as there is really no
> such method. Therefore there is (as far as the CLR is concerned) no
> need to initialise the Derived class.
Joanna,
I'll add a bit to Jon's reply since I know you have a Delphi background.
..NET does NOT load a class until it is ACTUALLY used. So the static constructor for a given class
will not be called, until the class is actually needed. All classes are load on demand, vs
Delphi where the units get their initialization sections called on start up of the application.
--
Chad Z. Hower (a.k.a. Kudzu) - http://www.hower.org/Kudzu/
"Programming is an art form that fights back"
Develop ASP.NET applications easier and in less time:
http://www.atozed.com/IntraWeb/
.
- Follow-Ups:
- Re: Override static derived variable
- From: Michael S
- Re: Override static derived variable
- From: Jon Skeet [C# MVP]
- Re: Override static derived variable
- From: Joanna Carter \(TeamB\)
- Re: Override static derived variable
- References:
- Override static derived variable
- From: knocte
- Re: Override static derived variable
- From: Joanna Carter \(TeamB\)
- Re: Override static derived variable
- From: Chad Z. Hower aka Kudzu
- Re: Override static derived variable
- From: Joanna Carter \(TeamB\)
- Re: Override static derived variable
- From: Jon Skeet [C# MVP]
- Override static derived variable
- Prev by Date: Re: How to transfer a string to char array
- Next by Date: Re: Override static derived variable
- Previous by thread: Re: Override static derived variable
- Next by thread: Re: Override static derived variable
- Index(es):
Relevant Pages
|