Summary
If you already come to the universe of .NET from another object-oriented language, this chapter may have been more of a quick compare and contrast between your current language of choice and C#. On the other hand, if you are exploring OOP for the first time, you may have found many of the concepts presented here a bit confounding. Fear not; as you work through the remainder of this book, you will have have numerous opportunities to solidify the concepts presented here.
This chapter began with a review of the pillars of OOP: encapsulation, inheritance, and polymorphism. Encapsulation services can be accounted for using traditional accessor/mutator methods, type properties, or read-only public fields. Inheritance under C# could not be any simpler, given that the language does not provide a specific keyword, but rather makes use of the simple colon operator. Last but not least, you have polymorphism, which is supported via the abstract, virtual, override, and new keywords.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
Rights and permissions
Copyright information
© 2005 Andrew Troelsen
About this chapter
Cite this chapter
(2005). Object-Oriented Programming with C# 2.0. In: Pro C# 2005 and the .NET 2.0 Platform. Apress. https://doi.org/10.1007/978-1-4302-0060-4_4
Download citation
DOI: https://doi.org/10.1007/978-1-4302-0060-4_4
Publisher Name: Apress
Print ISBN: 978-1-59059-419-3
Online ISBN: 978-1-4302-0060-4
eBook Packages: Professional and Applied ComputingProfessional and Applied Computing (R0)Apress Access Books