4.10. Wrap-UpIn this chapter, we presented the basic concepts of classes, objects, methods, instance variables and properties. You learned how to declare instance variables of a class to maintain separate data for each object of the class, and how to declare methods that operate on that data. You called methods and passed arguments to them. We explained the difference between a local variable of a method and an instance variable of a class. You used a class's constructor to specify the initial values for an object's instance variables. You saw how UML class diagrams model the constructors, operations, attributes and properties of classes. Finally, we demonstrated how Set accessors in properties can be used to validate an object's data and ensure that the object is maintained in a consistent state. In the next chapter we introduce control statements. |