CMSC 132- Midterm Exam Guide - Comprehensive Notes for the exam ( 32 pages long!)

253 views32 pages

Document Summary

New type of variable with a set of fixed values. We can add fields and methods to enums. In eclipse, we define them as we defined classes. Natural enumerated types: days of the week, phases of the moon. Sets where you know all possible values. The reference copy just makes a copy of the reference of the data. changing the copy also changes the original object. Shallow copies duplicate as little as possible. a shallow copy of a collection is a copy of the collection structure, not the elements. with a shallow copy, two collections now share the individual elements. Deep copies duplicate everything. a deep copy of a collection is two collections with all of the elements in the original collection duplicated. View software as a collection of objects. Provide high-level model of activity or data. Procedural abstraction-specify what actions should be performed. Definition- hiding implementation details while providing an interface (methods) for data access.