CSE 2221 Midterm 2

0.0(0)
studied byStudied by 0 people
0.0(0)
full-widthCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/83

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

84 Terms

1
New cards

Kernel Interface Design

The fundamental set of operations that define the core functionality of a component, forming the minimum necessary interface.

2
New cards

Constructor

A special method that initializes a newly created object and sets up its initial state.

3
New cards

No-Argument Constructor

A constructor that takes no parameters and creates an object with default initial values.

4
New cards

Copy Constructor

A constructor that creates a new object as a copy of an existing object.

5
New cards

Instance Method

A method that belongs to an instance of a class and operates on that specific object's data.

6
New cards

Receiver

The object on which an instance method is called (the object before the dot in method invocation).

7
New cards

Distinguished Formal Parameter

A special parameter in method documentation that represents the receiver object itself.

8
New cards

Parameter Modes

Specifications that describe how parameters are used by a method (restores, updates, replaces, clears).

9
New cards

Default Parameter Mode

The standard mode for parameters when no specific mode is declared (typically restores mode).

10
New cards

Primitive Type

Basic data types built into Java (int, double, boolean, char, etc.) that store actual values.

11
New cards

Reference Type

Types that store references (memory addresses) to objects rather than the actual object values.

12
New cards

Immutable Reference Type

A reference type whose object state cannot be changed after creation (e.g., String, Integer).

13
New cards

Mutable Reference Type

A reference type whose object state can be modified after creation (e.g., NaturalNumber, arrays).

14
New cards

Reference Diagrams

Visual representations showing how variables reference objects in memory.

15
New cards

Reference Value

The memory address or pointer that a reference variable holds.

16
New cards

Object Value

The actual data/state stored in an object in memory.

17
New cards

Assignment Operator (with Reference Types)

The = operator, which copies reference values (not object values) when used with reference types.

18
New cards

Call-by-Copy (with Reference Types)

Parameter passing mechanism where reference values are copied, allowing methods to access the same objects.

19
New cards

Garbage Collector

Java's automatic memory management system that removes objects no longer referenced by any variable.

20
New cards

Aliases / Aliasing of References

When multiple reference variables point to the same object in memory.

21
New cards

Arrays (Mutable Reference Type)

Fixed-size collections of elements that are reference types and can be modified after creation.

22
New cards

Scope

The region of code where a variable is accessible and valid.

23
New cards

Repeated Arguments

When the same object is passed multiple times as different parameters to a method.

24
New cards

NaturalNumber

A component representing non-negative integers with operations defined in its interface.

25
New cards

Standard

A secondary interface that extends a kernel interface with additional convenience operations.

26
New cards

@restores

Parameter mode indicating the method does not change the parameter's value.

27
New cards

@updates

Parameter mode indicating the method may modify the parameter's value.

28
New cards

@replaces

Parameter mode indicating the method replaces the parameter's value with a new value.

29
New cards

@clears

Parameter mode indicating the method changes the parameter to its initial (empty/zero) value.

30
New cards

== (with Reference Types)

Equality operator that compares reference values (checks if two variables point to the same object).

31
New cards

equals

Method that compares object values (checks if two objects have equivalent content/state).

32
New cards

Arrays.equals

Static method that compares arrays element-by-element for value equality.

33
New cards

null

Special reference value indicating a variable points to no object.

34
New cards

NullPointerException

Runtime error thrown when attempting to use a reference variable that has null value.

35
New cards

Interval Halving / Binary Search

Algorithm that repeatedly divides a search interval in half to efficiently find a target value.

36
New cards

Mathematical String Notation

Formal notation system for representing and reasoning about strings mathematically.

37
New cards

Empty String (Math)

A string with no characters, denoted as ε or "" with length 0.

38
New cards

Concatenation

Operation that joins two strings together end-to-end.

39
New cards

Substring

A contiguous sequence of characters within a string.

40
New cards

Prefix

A substring that starts at the beginning of a string.

41
New cards

Suffix

A substring that extends to the end of a string.

42
New cards

Substring Notation (Interval Notation)

Mathematical notation for extracting substrings using index intervals, like s[i,j).

43
New cards

Permutation

A rearrangement of elements where order matters, or the set of all possible rearrangements.

44
New cards

Fast Powering Algorithm

Efficient recursive algorithm for computing powers using repeated squaring.

45
New cards

|s|

Mathematical notation representing the length of string s.

46
New cards

rev(s)

Mathematical function that returns the reverse of string s.

47
New cards

perms(s1, s2)

Mathematical function that returns all permutations of strings s1 and s2 combined.

48
New cards

count(s, x)

Mathematical function that counts occurrences of character x in string s.

49
New cards

Recursion / Recursiveness

Programming technique where a method calls itself to solve a problem.

50
New cards

Recursive Structure

Data organization where elements are defined in terms of smaller versions of themselves.

51
New cards

Recursive Method

A method that includes at least one call to itself within its definition.

52
New cards

Recursive Design Strategy (FreeLunch)

Design approach that breaks problems into smaller self-similar subproblems.

53
New cards

Confidence-Building Argument

Reasoning that shows a recursive method works by verifying base cases and inductive steps.

54
New cards

Size Metric

A measure that decreases with each recursive call, ensuring the recursion eventually terminates.

55
New cards

Mathematical Induction

Proof technique that establishes a base case and shows if property holds for n, it holds for n+1.

56
New cards

Recursion on Trees

Recursive algorithms that process tree structures by recursively handling subtrees.

57
New cards

Inheritance

Mechanism where a class or interface acquires properties and behaviors from a parent class or interface.

58
New cards

Subinterface / Child Interface

An interface that extends another interface, inheriting its method declarations.

59
New cards

Superinterface / Parent Interface

An interface that is extended by another interface.

60
New cards

Subclass / Child Class

A class that extends another class, inheriting its fields and methods.

61
New cards

Superclass / Parent Class

A class that is extended by another class.

62
New cards

Overriding

Providing a new implementation of a method inherited from a superclass or interface.

63
New cards

Overloading

Defining multiple methods with the same name but different parameter lists in the same class.

64
New cards

Declared Type / Static Type

The type specified in a variable's declaration (known at compile time).

65
New cards

Interface Type

A declared type that specifies a contract of methods without implementation.

66
New cards

Instantiation

The process of creating an actual object instance from a class using the new keyword.

67
New cards

Object Type / Dynamic Type

The actual class type of an object created at runtime.

68
New cards

Polymorphism

Ability of objects of different types to be accessed through the same interface or to respond differently to the same method call.

69
New cards

implements

Keyword indicating a class provides implementations for all methods declared in an interface.

70
New cards

extends

Keyword indicating a class inherits from a superclass or an interface inherits from a superinterface.

71
New cards

super

Keyword used to reference the superclass or call superclass methods/constructors.

72
New cards

@Override

Annotation indicating a method is intended to override a method from a superclass or interface.

73
New cards

Unit Testing

Testing individual components or methods in isolation to verify they work correctly.

74
New cards

Integration Testing

Testing how multiple components work together when combined.

75
New cards

System Testing

Testing the complete, integrated system to verify it meets requirements.

76
New cards

Unit Under Test (UUT)

The specific component or method being tested.

77
New cards

Testing Mindset

Approach focused on finding defects and edge cases rather than confirming code works.

78
New cards

Test Case

A single test with specific inputs, expected outputs, and execution conditions.

79
New cards

Test Plan / Test Fixture

Collection of test cases organized to thoroughly test a component.

80
New cards

Boundary Cases

Tests at the edges of valid input ranges (e.g., empty, minimum, maximum values).

81
New cards

Routine Cases

Common, typical inputs that represent normal use of the component.

82
New cards

Challenging Cases

Complex or unusual inputs that stress-test the component's logic.

83
New cards

JUnit

Java testing framework that provides tools for writing and running unit tests.

84
New cards

@Test

Annotation that marks a method as a JUnit test case.