SEG 2105 Chapter Notes - Chapter 2: Abstract Type

43 views2 pages

Document Summary

2. 2 classes and objects: classes are the units of data abstraction in object-oriented program. A class defines a set of similar objects, its instance. All the objects with the same properties and behaviour are instances of one class: methods implement the behaviour of the objects. Variables that refer to objects are therefore called references. The type of a variable determines what classes of objects it may contain. 2. 4 methods, operations and polymorphism: an operation is polymorphic if the running program decides, every time an operation is called, which of several identically named methods to invoke. The program makes its decision based on the class of the object in a particular variable. If several classes have attributes, associations or operations in common, create a separate superclass that contains these common aspects. If you have a complex class, divide its functionality among several specialized subclasses: generalization the relationship between a subclass and an immediate superclass.

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