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

This chapter shows you how to create C# classes that include fields, properties, methods, constructors, and static methods. While most competing books waste your time by illustrating these concepts with unrealistic objects such as automobiles or animals, our book uses real-world business objects such as products and customers. In fact, this chapter presents a complete 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 the use of C# classes. You're not going to find realistic examples like this in competing books.

Chapter 12 How to create and use classes
An introduction to classes 330
How classes can be used to structure an application 330
The members you can define within a class 332
The code for the Product class 334
How instantiation works 336
How to create a class 338
How to add a class file to a project 338
How to code fields 340
How to code properties 342
How to code methods 344
How to code constructors 346
How to code static members 348
The Product Maintenance application 350
The operation of the Product Maintenance application 350
The classes used by the Product Maintenance application 352
The code for the Product Maintenance application 354
How to work with classes in Visual Studio 358
How to use the Class View window 358
How to use wizards to create class members 360




Murach's C#

Learn more about this book

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.