[CMPSC 122] - Final Exam Guide - Ultimate 24 pages long Study Guide!

372 views24 pages

Document Summary

Assignment statements associate an identifier (name) with an object. Identifiers can not begin with a numeral. Create alias by assigning a second identifier to an existing object. Changing the value of one identifier will break the alias. But, changes made to one alias will be apparent on the other. Instantiation often requires invoking a constructor, but many built-in classes support literal instantiation. Accessors are methods that return state info but do not modify an object. Mutators or update methods change the state of an object. Immutable: each object of the class has a fixed value upon instantiation. Float is immutable, but the identifier can be assigned to a different value. Bool class used in logic, true or false values. Stores a sequence of references to its elements. A tuple of length one is denoted (12,) Multi line start and end with "" or . Optimized method for checking whether a specific element is contained in the set.