Web Log di Adrian Florea

"You know you've achieved perfection in design, not when you have nothing more to add, but when you have nothing more to take away." Antoine de Saint-Exupery
posts - 440, comments - 2715, trackbacks - 3944

My Links

Archives

Post Categories

Image Galleries

.RO Blogs

.RO People

.RO Sites

Blogs

Furls

Links

vinCitori

The reference of the static field B.x triggers only the initialization of A (la spiegazione)

"it is useful to think of static members as belonging to classes" (C# Language Specification, 17.2.5). Nel nostro caso (B.x), la classe è A. Si può vedere anche dal codice IL:

ldsfld int32 A::x

E' quindi naturale che si chiami il costruttore statico della classe A e non quello della classe B...

Print | posted on martedì 10 agosto 2004 15:08 | Filed Under [ Carillon .NET ]

Powered by:
Powered By Subtext Powered By ASP.NET