Introduction to Classes, Objects, Methods and Strings in Visual C# 2010
- 4.1 Introduction
- 4.2 Classes, Objects, Methods, Properties and Instance Variables
- 4.3 Declaring a Class with a Method and Instantiating an Object of a Class
- 4.4 Declaring a Method with a Parameter
- 4.5 Instance Variables and Properties
- 4.6 UML Class Diagram with a Property
- 4.7 Software Engineering with Properties and set and get Accessors
- 4.8 Auto-Implemented Properties
- 4.9 Value Types vs. Reference Types
- 4.10 Initializing Objects with Constructors
- 4.11 Floating-Point Numbers and Type decimal
- 4.12 Wrap-Up
- Self-Review Exercises
- Answers to Self-Review Exercises
- Making a Difference Exercises
- Nothing can have value without being an object of utility.
- —Karl Marx
- Your public servants serve you right.
- —Adlai E. Stevenson
- You'll see something new. Two things. And I call them Thing One and Thing Two.
- —Dr. Theodor Seuss Geisel
In this chapter, we begin by explaining the concept of classes using a real-world example. Then we present five complete working applications to demonstrate how to create and use your own classes. The first four begin our case study on developing a grade book class that instructors can use to maintain student test scores. The last example introduces the type decimal and uses it to declare monetary amounts in the context of a bank account class that maintains a customer's balance.