ABSTRACT

Processing allows to work with data objects, such as a String object or an array. This chapter provides a brief introduction to creating own type of objects by creating a new class. An object is a special type of structure that contains: Variables that serve as attributes of the object; Functions known as methods, which make use of the attribute variables with the capability for certain actions that associate with this type of object. A class defines a type of object. An object is an instance of a particular class. A constructor has similarities to a function (method) and is used to create an object in memory and to initialize the attribute variables of an object. Using a constructor to create a new object is also known as instantiating that object. Multiple objects of the same class can be instantiated within a single program. Arrays of objects can be created.