August 2003
Beginner
600 pages
12h 55m
English
In addition to properties, most objects have methods. Methods are actions the object can perform, in contrast to attributes, which describe the object. To understand this distinction, think about the Pet object example. A Dog object has a certain set of actions that it can perform. These actions, called methods in Visual C#, include barking, tail wagging, and chewing carpet (don't ask). Figure 3.6 illustrates the Dog object and its methods.

Think of methods as functions—which is exactly what they are. When you invoke a method, code is ...
Read now
Unlock full access