In This Chapter
• Create variables for an object or class
• Use methods with objects and classes
• Call a method and return a value
• Create a constructor
• Send arguments to a method
this to refer to an object
• Create new objects
As you learned during the past chapter’s introduction to object-oriented programming (OOP), an object is a way of organizing a program so it has everything it needs to accomplish a task. Objects consist of attributes and behavior.
Attributes are the information stored within an object. They can be variables such as integers, characters, and Boolean values or objects such as
Calendar objects. Behavior consists of the groups of statements used to handle specific ...