Kron,
Have you tried it and compiled it?
public string Name {get; set;}
The above will not work. The compiler expects an implementation to the
property.
public abstract string Name {get; set;}
The above will work. It will require derived classes to override the
implementation.
If you want to provide a default implementation which can be overriden,
then you can use virtual:
public virtual string Name
{
get
{
return name;
}
set
{
name = value;
}
}
Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
-
mv*@spam.guard.caspershouse.com
<kr****@yahoo.comwrote in message
news:11**********************@74g2000cwt.googlegro ups.com...
Hi Folks
Can anyone confirm that the code
public string Name
{
get;
set;
}
is used to define an abstract property accessor?
would I also need to use the abstract keyword eg
public abstract string Name
{
get;
set;
}
Many Thanks
Kron