Re: Override static derived variable



Joanna Carter (TeamB) <joannac@xxxxxxxxxxxxxxx> wrote:
> I am not instantiating them for this example, I am just using static calls
> as demonstrated by the OP.
>
> Console.WriteLine(Thing.GetVar());
> Console.WriteLine(Derived.GetVar());

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.

--
Jon Skeet - <skeet@xxxxxxxxx>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
.



Relevant Pages

  • Re: 1871 Census
    ... Apologies for replying to my own post, but I forgot the references; ... Regards _ ... Prev by Date: ...
    (soc.genealogy.britain)
  • Re: Variables referenced in a project
    ... >> How do I find the references of a variable in the entire project which ... > compile - the compiler will lead you to the spot ... Maarten Wiltink ... Prev by Date: ...
    (comp.lang.pascal.delphi.misc)
  • Re: Run-time error 2424
    ... Have you tried to compile the project? ... Have you checked your references to make sure that are all there and ... none are missing? ... Prev by Date: ...
    (microsoft.public.access.formscoding)
  • Re: MarshalByRefObject
    ... > below my signature in the previous ... cut and paste your code, compile it, run it and see the problem. ... If replying to the group, please do not mail me too ... Prev by Date: ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: error on build
    ... I couldn't tell you i dont work with C# normally just VB.NET this is code ... >> this is in .NET 2.0, so im not sure why there are still references to ... > file and then try to compile 2.0 code. ... > If replying to the group, please do not mail me too ...
    (microsoft.public.dotnet.languages.csharp)

Loading