property get and set accessors

  • Thread starter Thread starter Mike P
  • Start date Start date
M

Mike P

What does it do when you have a property with get and set accessors like
this?

public int PasswordAttemptWindows { get; }


Thanks,

Mike
 
You're sample code won't compile.
If you have an empty get; body then you must declare the property as
<b>abstract</b>

public abstract int PasswordAttemptWindows { get; }

When you declare a property this way, then the class that it is found
in can't be instantiated . You have to derive another class from that
class, and the derived class must put a body for the
PasswordAttemptWindows accessor.
Hope that clarifies things.

Rob Vretenar [imason inc.]
 
Thanks Rob, I thought it was something to do with abstract classes as
I've seen that sort of code before, but up till now I never knew what it
was for.


Cheers,

Mike
 
Back
Top