P
Peter Morris
Hi, just learning C# from a book.
I've learned *how* to use properties, but not why. What are they
used for? Why have a private attribute that you can access
through properties? If you want it to be accessible, why not
just make it public? What is the advantage of using a property?
Also, why use delegates? This seems a particularly complex and
roundabout way of writing a method. Also the code for the method
is defined outside the class, doesn't this defeat the point of
encapsulation? Why would you do it this way?
--
_______________________
/_____________________(_)
| _____________________ email to
| | |__________________(_) Peter_Morris_1 at
| |/____________________ btinternet dot com
|_____________________(_)
I've learned *how* to use properties, but not why. What are they
used for? Why have a private attribute that you can access
through properties? If you want it to be accessible, why not
just make it public? What is the advantage of using a property?
Also, why use delegates? This seems a particularly complex and
roundabout way of writing a method. Also the code for the method
is defined outside the class, doesn't this defeat the point of
encapsulation? Why would you do it this way?
--
_______________________
/_____________________(_)
| _____________________ email to
| | |__________________(_) Peter_Morris_1 at
| |/____________________ btinternet dot com
|_____________________(_)