Book Image

Learning Object-Oriented Programming

By : Gaston C. Hillar
Book Image

Learning Object-Oriented Programming

By: Gaston C. Hillar

Overview of this book

Table of Contents (16 chapters)
Learning Object-Oriented Programming
Credits
About the Author
Acknowledgments
About the Reviewers
www.PacktPub.com
Preface
Index

Chapter 3. Encapsulation of Data

In this chapter, we will start organizing data in blueprints that generate objects. We will protect and hide data in each of the three covered programming languages: Python, JavaScript, and C#. We will:

  • Understand the different members of a class

  • Learn the difference between mutability and immutability

  • Customize methods and fields to protect them against undesired access

  • Work with access modifiers, naming conventions, and properties

  • Customize getter and setter methods

  • Create properties with getters and setters in Python, C#, and JavaScript