# Encapsulation

In this chapter, we will begin to discuss the concepts of Object-oriented programming (OOP). OOP is a style of programming that is very common in our industry today. OOP is built on the concept of 4 fundamental principles to help organize your code and projects. These are called the **4 Pillars of OOP**. They are **Encapsulation, Inheritance, Polymorphism** and **Abstraction**. We will begin by learning about Encapsulation.

Updated: November 16, 2026

## [Working with Objects](https://www.ask-codey.com/courses/java-full-stack-bootcamp/topics/working-with-objects)

1. [Working with Objects: an overview](https://www.ask-codey.com/lessons/working-with-objects-an-overview) (Novice): Object-oriented programming models a program on real things: objects that each have a job to do.
2. [What is an Object](https://www.ask-codey.com/lessons/working-with-objects-what-is-an-object) (Novice): Every object has a responsibility, and modeling a program starts with listing the objects and what each one is for.
3. [Defining an Object](https://www.ask-codey.com/lessons/working-with-objects-defining-an-object) (Apprentice): An object's responsibilities split into what it knows (its variables) and what it can do (its methods), and a class is the blueprint that describes both.
4. [Writing the Class in Java](https://www.ask-codey.com/lessons/working-with-objects-writing-the-class-in-java) (Apprentice): Turn a class design into Java with private variables, getters and setters, and methods, then create an object from it with new.
5. [What is a Constructor](https://www.ask-codey.com/lessons/working-with-objects-what-is-a-constructor) (Apprentice): A constructor gives a new object the starting values it needs, and \`this\` tells the object's own variable apart from a parameter with the same name.

## [Objects from a Database](https://www.ask-codey.com/courses/java-full-stack-bootcamp/topics/objects-from-a-database)

1. [Objects from a Database: an overview](https://www.ask-codey.com/lessons/objects-from-a-database-an-overview) (Journeyman): Most Java applications work with data from a database, so many of their classes model a table, with one object for each row.
2. [Creating Data Models](https://www.ask-codey.com/lessons/objects-from-a-database-creating-data-models) (Journeyman): A data model class mirrors a database table, with a private variable and a getter and setter for each column.

Source: https://www.ask-codey.com/courses/java-full-stack-bootcamp/chapters/encapsulation
