Murach's C# 2008
How to create and use classes

This chapter shows you how to create your own C# classes that include fields, properties, methods, constructors, and static methods. While many competing books illustrate these concepts with unrealistic objects such as automobiles or animals, this book uses real-world business objects such as products and customers.
     In fact, this chapter presents an application that uses a Product class to create Product objects and a ProductDB class that uses static methods to handle the application's database access. That's the type of complete application that you need to see if you want to understand object-oriented programming in C#.

Chapter 12 How to create and use classes
An introduction to classes 346
How classes can be used to structure an application 346
The members you can define within a class 348
The code for the Product class 350
How instantiation works 352
How to create a class 354
How to add a class file to a project 354
How to code fields 356
How to code properties 358
How to code methods 360
How to code constructors 362
How to code static members 364
The Product Maintenance application 366
The operation of the Product Maintenance application 366
The classes used by the Product Maintenance application 368
The code for the Product Maintenance application 370
How to use the Class View window and class diagrams 374
How to use the Class View window 374
How to use class diagrams and the Class Details window 376
How to work with structures 378
How to create a structure 378
How to use a structure 378




Murach's C# 2008

Learn more about this book

View the table of contents

Add this book to your cart



Our Ironclad Guarantee

First, try our books for 90 days. Then, if you aren't completely convinced that our books are the best ones you've ever used, you can return them for a full refund...no questions asked.