esse quam videri
Revision as of 00:17, 9 August 2019 by Parker (talk | contribs) (Explanation)
Jump to: navigation, search


Objects are instances of a particular class or subclass that is able to use that class's own methods or procedures and data variables.

In object-oriented programming (OOP), programs are designs with objects in mind - they are the centerpiece in constructing your units of code!

  1. The object is what actually runs in the computer.
  2. In Encapsulation, objects manage their own states through methods of its class type.
  3. Through Polymorphism, any objects or classes that inherit methods or variables from a parent are able to use them exactly like that parent class! Each child, however, keeps its own methods as they are.

So, child objects and classes can use these methods without affecting their parent class’s methods and variables.



Like a program or class type, objects have variables and method - but the added benefit of an object is that it can be invoked or instantiated like a method!

Objects can determine the behavior of the class they're created from. When you call an object in code, you can tell it to invoke one of its data variables or functions! From a programming point of view, an object can be a data structure, a variable or a function. It has a memory location allocated. The object is designed to be part of a class's hierarchy.

Think of a cup of coffee - there are a lot of different types of coffees around, but they each have similar characteristics. There are different flavors, sizes, and prices - but they're all still coffee!

Let's create a class called Coffee with the properties flavor, size, and price:

class Coffee
    public string flavor;
    public int size;
    public float price;


See also


External Links