CS 1110 Prelim 2 Flashcards

0.0(0)
Studied by 1 person
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/28

flashcard set

Earn XP

Description and Tags

Vocabulary flashcards covering core object-oriented programming concepts and Python definitions from the CS 1110 Prelim 2 review notes.

29 Terms

1
New cards

Abstraction

Making a complex class act like a familiar type using methods or operator overloading.

2
New cards

Accumulator

A variable updated in a loop that stores computed information for use afterward.

3
New cards

Attribute

A variable stored in an object (instance attribute) or belonging to a class (class attribute).

4
New cards

Bottom-Up Rule

Python searches the object, then its class, then parent classes until it finds an attribute or method.

5
New cards

Class

A user-defined type whose values are objects.

6
New cards

Class Definition

A blueprint specifying the attributes and methods shared by objects of a class.

7
New cards

Constructor

A call like RGB(255,0,255) that creates an object, executes init, and returns the object reference.

8
New cards

Default Argument

A parameter's fallback value if omitted; specified as y=2 in the function header.

9
New cards

Encapsulation

Hiding data and implementation details, often using hidden attributes, getters, and setters.

10
New cards

Getter

A method that returns a hidden instance attribute without allowing direct modification.

11
New cards

Global Space

Memory for variables defined outside functions; they persist until removed or Python exits.

12
New cards

The Heap

Memory holding objects, class folders, function definitions, and imported module contents.

13
New cards

Immutable Attribute

A hidden attribute with a getter but no setter; users cannot modify it through the interface.

14
New cards

Implementation

The actual code satisfying a specification; it can change as long as the specification remains satisfied.

15
New cards

Inheritance

A subclass receives attributes and methods from its superclass without redefining them.

16
New cards

Interface

Public information needed to use code, such as function headers, specifications, and public methods.

17
New cards

Instance

An object created from a class; synonymous with object.

18
New cards

Invariant

A condition on one or more attributes that must always remain true.

19
New cards

is Operator

Tests whether two variables refer to the same object, not whether their contents are equal.

20
New cards

isinstance

isinstance(ob,C) is True if ob belongs to class C or a subclass of C.

21
New cards

Method

A function defined within a class; when called on an object, that object is passed as self.

22
New cards

Mutable Attribute

A hidden attribute with both getter and setter; changes must preserve invariants.

23
New cards

Object

An instance of a class, typically containing attributes and supporting methods.

24
New cards

Operator Overloading

Defining operator behavior for objects using special methods such as add and eq.

25
New cards

Overriding a Method

Redefining an inherited method in a subclass; super().method() can call the parent version.

26
New cards

Setter

A method that modifies a hidden attribute while enforcing its invariants or preconditions.

27
New cards

Subclass

A class extending another class and inheriting its attributes and methods.

28
New cards

Instance Attribute vs. Class Attribute

Instance attributes belong to individual objects; class attributes belong to the class.

29
New cards

Interface vs. Implementation

Interface tells users how to use code; implementation is the hidden code that makes it work.