Home > Articles > Programming > C#

  • Print
  • + Share This
This chapter is from the book

This chapter is from the book

Summary

Object-oriented programming is an advanced methodology that enables you to create more robust applications; programming classes is the foundation of OOP. In this hour, you learned how to create classes, which are the templates used to instantiate objects. You learned how to create a custom interface consisting of properties and methods and how to use the classes you've defined to instantiate and manipulate objects by way of object variables. You've also learned how you should implement a Dispose() method for classes that consume resources and how it is important to call Dispose() on objects that implement it to ensure that the object frees up its resources as soon as possible. Finally, you learned how objects aren't destroyed as soon as they are no longer needed; rather, they become eligible for garbage collection and are destroyed when the garbage collector next cleans up.

In this hour, you learned the basic mechanics of programming objects with classes. Object-oriented programming takes considerable skill, and you'll need to master the concepts in this book before you can really begin to take advantage of what OOP has to offer. Nevertheless, what you learned in this hour will take you further than you might think. Using an OOP methodology is as much a way of thinking as it is a way of programming; consider how things in your projects might work as objects, and before you know it, you'll be creating robust classes.

  • + Share This
  • 🔖 Save To Your Account