Object Oriented Programming Part 2: Classes in Depth

In part 1 we discussed what an object is. For a brief review, an object is an instance of a class. A class is a file with code in it.

In today’s post, we will cover classes more in depth. If you recall the Chair class example, it only contained properties. Classes can also contain methods, fields, and member variables.

Let’s look at these items in more detail.

Before we delve into properties and methods, let’s take a look at access modifiers. They are a key feature of OOP because it allows functionality be encapsulated in a class.

Continue reading