3.3 - Objects

Object-Oriented Programming (OOP) was first proposed in the 1960's as way of organizing reusable code in a more humanized fashion. It provides a way of outline what an object is (called a "class") and then the programmer can declare multiple copies of that type of object.

Think of a String, for example. At its most basic level, a String is an array of character variables. Characters (or chars) are a "primitive" data type. They are stored as simple binary and they are not complex. The letter "A" has no properties beyond the fact that it is number 65 in a table of images.

An array, however, is a complex data structure. It has direction (a beginning and end), a length, and several functions (or methods) to manipulate the contents or the array itself.

A String continues to build on the array by adding extra functionality - toUpperCase(), substring(), etc... In this way, it takes the complex structure of an array of characters, and adds extra functionality. Not to mention, a String is immutable - meaning we cannot change the individual characters, like we could if it were a simple array.

A String is an Object. It can be cloned, we can make as many as we want, it has methods specific to manipulating or duplicating it, and it is not a simple primitive data type.