Re: ?? 'new' and 'protected' Modifiers on Structs ??
- From: Marc Gravell <marc.gravell@xxxxxxxxx>
- Date: Tue, 30 Oct 2007 22:13:05 -0700
And on the "protected" side - it again relates to things that subclass
the containing class - i.e.
public class BaseClass {
void TestBase() {
NestedStruct ns;
}
private struct NestedStruct { int a;}
}
public class SubClass : BaseClass {
void TestSub() {
NestedStruct ns; // **ERROR
}
}
The above is illegal, since SubClass cannot see BaseClass.NestedStruct
(since it is private); however, change NestedStruct to be protected,
and any sublasses of BaseClass can now see it.
Marc
.
- References:
- ?? 'new' and 'protected' Modifiers on Structs ??
- From: Tom Baxter
- ?? 'new' and 'protected' Modifiers on Structs ??
- Prev by Date: Problem with class Not existing that does
- Next by Date: Re: How is fastest way to construct an XML node then a bunch of slow xquery modify statements?
- Previous by thread: Re: ?? 'new' and 'protected' Modifiers on Structs ??
- Next by thread: Generate image with WPF
- Index(es):
Relevant Pages
|