Reading Chapter 4 Section 5 - mutator: a method that changes a property of an object - usually a single property is maintained by a single data member - how a property of an object is represented inside the object - internal detail - does not concern the client programmers - accessor: method that returns a property of an object - common practice to define mutators and accessors in pairs - naming multiple methods with the same name just like constructors - allowed - rules - must have a different number of parameters OR - parameters must have different data types - overloaded method: method that has the same name as another method in the class - duplicating code - avoid whenever possible - makes modification of code tedious and error-prone because must locate all places where changes made - calling a method from a method of the same object - allowed - dot notation - allowed - not required - use in conjunction with the reserved word this - more common not to use - calling methods within constructors - allowed - instance not created until a constructor complete execution - rules - if used, the call to a different constructor must be the first line - instance methods may not be used as arguments a different constructor - important to test other - all constructors and methods with different values for arguments - different combinations of mutators and accessors Quick Check 1. class One { private int var1; private int var2; public m1() { this.var1 = 20; this.m2(this.var1); } public m2(int x) { this.var2 = x * 2; } } 2. It involves code duplication. It could use other methods, already defined, which apply these formulas. That would prevent the same formulas from appearing in multiple places.