9. Well-Formed Types
The previous chapters covered most of the constructs for defining classes and structs. However, several details remain to round out the type definition with fit-and-finish-type functionality. This chapter explains how to put the final touches on a type declaration.
Overriding object Members
Chapter 6 discussed how all classes and structs derive from object
. In addition, it reviewed each method available on object
and discussed how some of them are virtual. This section discusses the details concerning overriding the virtual methods.
Overriding ToString()
By default, calling ToString()
on any object will return the fully ...
Get Essential C# 6.0 now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.