As described in previous chapters, a class is a blueprint for an object. All objects within a class will have the same methods, however, they may behave differently depending on instance variables. Arguments are passed on to methods as parameters. Arguments are generated within a method, and sent somewhere. Parameters are arguments from one method that were sent to another method. values can be returned from methods using the return command. When a method is declared to return a value, the method must be declared using the same, or a compatible variable type as the returned value. methods can have multiple parameters, but they will be arranged in the order they were sent in as arguments, regardless of what the parameters are named.
Getters and setters, or accessors and mutators, set and retrieve data. For example, a setter method will set a variable, then the getter method is called to retrieve the value that was originally set. However we have a problem because all of our data thus far has been exposed, meaning any reference variable can change anything with a dot operator. This can be prevented by making all instance variables start with "private" and all getter and setter methods "public" so they can be accesses anywhere.
Even if Instance variables are not assigned values, they have a default value. integers is 0, floats are 0.0, booleans are false, and references are null. Instance variables are declared within a class but not within a methoid and local variables are declared within a method. Local variables, unlike Instance variables, need a value assigned to them before use. They do not have a default value. to see if any primitive variables are equal, one can use the == operator. The same goes to see if two reference variables refer to the same object. However the == operator cannot be used when seeing if two objects are the same. for that one must use the equals() method.