Object-Oriented (OO) Programming
Object-oriented programming is a paradigm that was created to allow software engineers to build large software applications. The motivating factor was to have reusable components so that a programmer would not have to “reinvent the wheel” each time he or she needed a procedure to solve a subproblem. Furthermore, the developers of OO languages felt that important data or information and its associated operations should be grouped together for both readability and, more importantly, maintainability.
The programming language construct that allows for the combination of data and operations is known as a class. A class can specify an actual real-world item (e.g., Card) that one could touch or an abstract object (e.g., Holiday). Note that an object is an instance of a class.
A class has attributes or instance variables that are usually specified as privatein Java. In other words, the data cannot be accessed or changed outside of the class without using methods. The access methods are...