posted on Monday, March 15, 2004 8:55 AM
by
jdixon
Overridden Properties handled differently in C# and VB (Correction)
In a previous post (see Overridden Properties handled differently in C# and VB) I wrote that C# and VB were handling overridden properties differently. This is not the case. Brian Orrell wrote:
In C# you have not created a readonly property. You have simply only chosen to override the get implementation of the property. Try it out. If you use the derived class, you will have no problem setting the property that seems to be readonly.
The only difference is that VB does not allow you to override just one of the two accessor methods.
You can never make the accessibility of a derived class LESS than the accessibility of the ancestor.
After a quick check, I found that he is correct. I want to thank Brian for the heads-up, and to let everyone else have the correct information.
Thanks Brian!