Classes, Objects, and Methods
Attributes – data components of a class that provide and traits for the object of that class; also called fields, properties, and instance variables
Methods – code associated with an object in order to make it function and behave according to the class to which it belongs:
Constructor methods – to create or instantiate objects from the class definition
A default constructor will always be created and will initialize fields to 0, false, or null
Create your own constructor method with the same name as the default when the default values are not wanted, this is called overloading
Mutator/Accessor methods – to set and retrieve the instance variables/fields associated with each object that is created from the class
Mutators are used to directly access an object’s field to set it’s value
Mutator methods begin with the prefix “set” followed by the name of the corresponding instance variable
Mutators do not have a return value, void
Accessors are used to directly access an object’s field to get or retrieve it’s value
Accessor methods begin with the prefix “get” followed by the name of the corresponding instance variable
Accessors return this.variable
Behavior methods – to create the actions and functionality of the object
Class Header – made of three parts: access modifier, keyword class, name of class
Data Fields – or Instance variables, declared with private in order to protect data and hide information
This – refers to the current object being built, also helps to further distinguish between local variables from the parameter list and the object’s field variables
Encapsulation – the inclusion within an object of all the resources needed for the object to function, thought to be self-contained
Object Interface – how the client code can interact with an object through its public methods
Functional Decomposition – creating clearly defined behavioral/functional methods for a