 object or class. In this learning activity, we will define the terms class and object as used by computer programmers in contrast to the important differences. As a computer programmer, object-oriented programming is one of the most important tools at your disposal. Understanding what an object is and how classes are used to create objects is a fundamental concept you need to master. In object-oriented programming, or OOP, objects serve as logical models of real-life things. By organizing your code into objects, it is far easier to write code that represents reality. Objects allow the programmer to think about the application in a way that mirrors the real world. For example, in the context of a retail software application, there are likely to be objects created with code that model products, customers, and orders. When first exposed to the world of object-oriented programming, it is not unusual for beginning programmers to confuse the terms objects and classes. They are absolutely not the same thing, and the terms shouldn't be used interchangeably. A simple rule to help remember the difference is a class lives in code and an object lives in memory. Let's start with the textbook definition of an object. An object is an instance of a class. This is actually an excellent definition, provided you already understand the meaning of the terms class and instance. Let's walk through the definitions and roles of these terms, using some examples you are already familiar with. A class is a blueprint for an object. Specifically, a class is code you write that defines what an object is to be. Those definitions describe attributes and behavior. Attributes being characteristics of an object, and behavior being things that an object can do. Let's look at a familiar kind of blueprint, an architectural blueprint of a house. The blueprint for a house describes the rooms, dimensions, the locations of the walls, etc. Behavior is also implied. Doors can open and close, and those behavioral details are also included on the blueprint. However, a blueprint is not a house, right? It defines the house and how it should be built, but it takes a team of construction workers and physical materials to actually build one. The blueprint lives on paper, the house lives in the physical world. So what is an instance? Think about it this way. Can you build more than one house from the same blueprint? Sure you can, and each of those houses could be described as a physical instance of that blueprint. But you are not a building architect, you're a computer programmer. In the programmers world, the class is the blueprint. Here's what the blueprint for a house might look like in code. In this case, we are using the C-sharp programming language, but the concept is the same in many languages. We see a class named house, a definition of its characteristics, referred to as attributes, and its behavior, defined as methods. Remember, this class is only a blueprint, it is not yet real. To turn a class into an object, we write code that instructs the computer to construct an object in memory. In C-sharp, the new keyword is that instruction. Of course, there is no team of construction workers, and the house object is not created in the physical world, the computer instead creates the house object in memory, allowing the programmer to write code to interact with it. Programmers have a term for this exact thing, instantiation. Instantiation is the process of constructing an object from a class. In C-sharp, using the new keyword. Can you create more than one house object from the house class? We'll sure you can. And each one of those is a distinct and separate thing. Each one is its own instance of the house class. Remember when we said a class lives in code, and an object lives in memory. We also defined an object as an instance of a class. Now that we have looked at what it means when we say instance, we see that each instance of our house class is indeed an object constructed in memory. In this activity, we defined a class as a blueprint written in code, from which instances of objects are created in memory. With a solid understanding of this fundamental concept, you are now ready to begin thinking like an object-oriented programmer. You have completed object or class.