ITEC 2610 Lecture Notes - Lecture 1: Mutator Method, Static Variable, Reserved Word

111 views3 pages

Document Summary

The name of the class should be a noun and should also relate to the topic of the class. A class represents a single concept from a problem domain, such as a business, science, or mathematics. The public interface of a class is cohesive if all of its features are related to the concept that the class represents. A class depends on another class if its methods use that class in any way. It is best to decouple input/output from the work of your classes: place the code for producing output or consuming input in a separate class. A mutator method changes the state of an object. Accessors ask the object to compute a result without changing its state. An immutable class has no mutator methods. In an immutable class, it is best to separate accessors and mutators. References to an object in an immutable class can be safely shared.

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related Documents