View Tutorial Content

Encapsulation in object-oriented programming

Tutorial
Foundational
+10 XP
20 Mins
(1636)
Overview
Live
Groups
Summary
In this tutorial, you’ll learn about the second pillar in object-oriented programming: encapsulation.
  • Explain how encapsulation is used to write code that can only be used as intended by the programmer
  • Control access to data within a class by applying encapsulation with getters and setters
  • Differentiate between public variables (properties), private variables (fields), and local variables.
  • Enable easier readability and debugging by correctly organizing classes to include only singular purpose code
Select your Unity version
Last updated: September 08, 2021
2020.3
Language
English
Encapsulation in object-oriented programming