Re: Making static class ToString() not possible, why?
- From: Jon Skeet [C# MVP] <skeet@xxxxxxxxx>
- Date: Thu, 19 Apr 2007 20:33:16 +0100
Zytan <zytanlithium@xxxxxxxxx> wrote:
"A static member 'function' cannot be marked as override, virtual or
abstract"
Is it possible to make a static class member function (which is also
static, obviously) that is an override to ToString()? Maybe it makes
no sense to do such a thing...
No, it doesn't. "Override" involves polymorphism, and polymorphism
doesn't apply to static members. To convince yourself of this, try to
work out what situation you'd expect it to be invoked in.
--
Jon Skeet - <skeet@xxxxxxxxx>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too
.
- Follow-Ups:
- References:
- Prev by Date: Re: Bug in C# 2.0 compiler?
- Next by Date: Re: Binding to datagridview
- Previous by thread: Re: Making static class ToString() not possible, why?
- Next by thread: Re: Making static class ToString() not possible, why?
- Index(es):
Relevant Pages
|
Loading