Object-oriented programming, often shortened to OOP, is a term that is used to describe languages that support the concept of "objects" in programming. Objects can represent real things or objects, as well as abstract things. For example, an object can represent a car, an animal, an error, a color, clothing items, etc. Objects contain data, known as properties, and can perform methods.
There are 4 pillars, or rules, of OOP:
Inheritance, the sharing of information
Abstraction, the hiding of information
Encapsulation, the grouping of information
Polymorphism, the redefining of information
Moreover, there are 3 qualities that make a language a pure OOP language.
Pre-defined types are objects
User-defined types are objects
Methods must be called on objects
Java is considered an OOP language because it follows (although not strictly) these rules. These topics will be covered later in the advanced section.
One of the defining characteristics of OOP languages are classes. Objects are instances of a class. Think of a class as a blueprint for creating classes—for example, when you buy a LEGO® construction set, the blueprint for creating the model is like a class, and the final product is an object.
In programming, there is a concept known as memory. The more memory your program uses, the slower it will run, and the less efficient it will be. Java, like many languages today, manages the memory your program uses automatically through use of a garbage collector. It collects the memory used by objects that are no longer being used by the program, and opens that memory back up to the program.
Generally, memory management isn't that much of a concern with a garbage collector, but if your program becomes very large or memory-intensive, you should consider what parts of your program is running slow and refactor (rethink) that code.