1/83
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced |
|---|
No study sessions yet.
Kernel Interface Design
The basic, essential methods that a component must have. Think of it as the "minimum toolkit" needed to make the component work.
Constructor
A special method that runs when you create a new object. It sets up the object's starting values.
No-Argument Constructor
A constructor that doesn't need any information passed to it. Example: new NaturalNumber1L() with no parameters.
Copy Constructor
A constructor that creates a duplicate of an existing object. Example: NaturalNumber copy = new NaturalNumber1L(original).
Instance Method
A method you call on a specific object using the dot. Example: myNumber.clear() - clear() is the instance method.
Receiver
The object that a method is being called on. In myNumber.clear(), myNumber is the receiver.
Distinguished Formal Parameter
In method documentation, this represents the object the method is called on (the receiver). Usually shown as "this" in the contract.
Parameter Modes
Tags in Javadoc that tell you what happens to a parameter: does it stay the same, get modified, get replaced, or get cleared?
Default Parameter Mode
When no mode tag is given, we assume the parameter stays unchanged (restores mode).
Primitive Type
Simple data types that hold the actual value directly. Examples: int x = 5, boolean flag = true, char letter = 'A'.
Reference Type
Types that hold a "pointer" to where the actual object lives in memory, not the object itself. Examples: String, NaturalNumber, arrays.
Immutable Reference Type
An object that can't be changed once created. Example: String - when you "change" a String, you actually create a new one.
Mutable Reference Type
An object whose contents can be modified after creation. Example: NaturalNumber can be incremented, arrays can have elements changed.
Reference Diagrams
Drawings that show variables as boxes with arrows pointing to the actual objects in memory. Helps visualize aliasing.
Reference Value
The "address" or "pointer" stored in a reference variable - it tells Java where to find the actual object.
Object Value
The actual data stored inside an object (like the number 42 inside a NaturalNumber object).
Assignment Operator (with Reference Types)
When you write x = y with reference types, you copy the pointer, not the object. Both x and y now point to the same object.
Call-by-Copy (with Reference Types)
When passing objects to methods, Java copies the reference (pointer), so the method can modify the same object.
Garbage Collector
Java's automatic cleanup system that deletes objects no longer being used by any variable.
Aliases / Aliasing of References
When two or more variables point to the exact same object. Change through one variable affects the other.
Arrays (Mutable Reference Type)
A fixed-size container holding multiple elements. Can modify elements after creation. Example: int[] numbers = new int[5].
Scope
Where in your code a variable can be used. Variables declared in a method only exist inside that method.
Repeated Arguments
Passing the same object as multiple parameters to one method. Example: myMethod(x, x, x) where x appears three times.
NaturalNumber
An OSU component representing non-negative whole numbers (0, 1, 2, 3…) with special methods for manipulation.
Standard
An interface that adds extra convenient methods on top of the kernel. Example: Standard might add increment() when kernel only has add().
@restores
Method promise: "I won't change this parameter's value." Input stays exactly the same.
@updates
Method promise: "I might modify this parameter." The value could change.
@replaces
Method promise: "I'll give this parameter a completely new value." Old value is gone.
@clears
Method promise: "I'll reset this parameter to empty/zero." Like hitting the clear button.
== (with Reference Types)
Checks if two variables point to the SAME object in memory. Doesn't check if contents are equal.
equals
Method that checks if two objects have the same contents/value, even if they're different objects in memory.
Arrays.equals
Special method to check if two arrays have the same elements in the same order.
null
A special value meaning "this variable doesn't point to any object." Like an empty parking space.
NullPointerException
Error you get when trying to use a variable that's null. Like trying to open a door that doesn't exist.
Interval Halving / Binary Search
Search method that cuts the search area in half each time. Much faster than checking every item one by one.
Mathematical String Notation
A formal way to write and work with strings using math symbols instead of Java code.
Empty String (Math)
A string with zero characters. Written as "" or ε (epsilon). Length is 0.
Concatenation
Sticking two strings together. "Hello" + "World" = "HelloWorld".
Substring
A piece of a string. "cat" is a substring of "concatenate".
Prefix
A substring that starts at the beginning. "pre" is a prefix of "prefix".
Suffix
A substring that goes to the end. "fix" is a suffix of "suffix".
Substring Notation (Interval Notation)
Math way to write "give me characters from position i to j". Like s[0,3) means first 3 characters.
Permutation
All possible orderings of items. "AB" and "BA" are the two permutations of A and B.
Fast Powering Algorithm
Clever way to calculate powers by squaring repeatedly. To get 2^8, calculate 2^4 then square it, instead of multiplying 2 eight times.
|s|
Math symbol for "length of string s". If s = "hello", then |s| = 5.
rev(s)
Math function that reverses a string. rev("hello") = "olleh".
perms(s1, s2)
Math function that finds all permutations of two strings combined together.
count(s, x)
Math function that counts how many times character x appears in string s.
Recursion / Recursiveness
When a method calls itself to solve a problem by breaking it into smaller versions of the same problem.
Recursive Structure
Data organized like nested Russian dolls - each piece contains smaller pieces of the same type.
Recursive Method
A method that has at least one call to itself inside its own code.
Recursive Design Strategy (FreeLunch)
Strategy where you assume smaller problems are already solved, then just handle combining those solutions.
Confidence-Building Argument
Explanation showing recursion works: prove the base case works, then show if size N works, size N+1 also works.
Size Metric
A number that gets smaller with each recursive call, ensuring the recursion eventually stops at the base case.
Mathematical Induction
Proof method: show it works for the smallest case, then show if it works for N it works for N+1. Therefore it works for all cases.
Recursion on Trees
Using recursion to process tree structures by handling one node, then recursively processing its children.
Inheritance
When one class/interface gets to use all the methods and variables from another class/interface automatically.
Subinterface / Child Interface
An interface that extends another interface, getting all its method requirements plus adding new ones.
Superinterface / Parent Interface
The interface being extended by another interface. It's the "parent" in the relationship.
Subclass / Child Class
A class that extends another class, inheriting all its fields and methods.
Superclass / Parent Class
The class being extended. It's the "parent" that shares its code with child classes.
Overriding
Writing a new version of a method that was inherited from a parent class/interface. Same name and parameters, new code.
Overloading
Having multiple methods with the same name but different parameters in one class. Example: add(int x) and add(double x).
Declared Type / Static Type
The type written in the variable declaration. In "NaturalNumber x = new NaturalNumber1L()", NaturalNumber is the declared type.
Interface Type
A type that only defines what methods must exist, not how they work. Can't create objects directly from an interface.
Instantiation
Creating an actual object using "new". This is when memory is allocated and the constructor runs.
Object Type / Dynamic Type
The actual class of the created object. In "NaturalNumber x = new NaturalNumber1L()", NaturalNumber1L is the object type.
Polymorphism
Using a parent type variable to hold different child type objects. Allows treating different types the same way.
implements
Keyword saying "my class will provide code for all methods in this interface". Class must write all interface methods.
extends
Keyword for inheritance. "class B extends A" means B inherits everything from A. "interface B extends A" means B includes all of A's methods.
super
Keyword to access the parent class. Use super() to call parent constructor or super.method() to call parent's version of a method.
@Override
Annotation that tells Java "I'm intentionally replacing a parent's method." Helps catch typos in method names.
Unit Testing
Testing one small piece of code (like one method) by itself to make sure it works correctly.
Integration Testing
Testing how multiple pieces of code work together after combining them.
System Testing
Testing the entire completed program to make sure everything works together as expected.
Unit Under Test (UUT)
The specific method or component you're currently testing.
Testing Mindset
Thinking like you're trying to break the code. Look for problems and edge cases, not just happy paths.
Test Case
One single test with specific input values, expected output, and instructions for what to check.
Test Plan / Test Fixture
A complete set of test cases designed to thoroughly check if a component works correctly.
Boundary Cases
Tests using extreme values like empty, zero, maximum size, or edges of valid ranges. Often where bugs hide.
Routine Cases
Tests using normal, typical values that represent how the code will usually be used.
Challenging Cases
Tests using complex or tricky inputs that really exercise the logic and might reveal subtle bugs.
JUnit
A Java library that provides tools and structure for writing and running automated tests.
@Test
Annotation marking a method as a JUnit test. JUnit will automatically run all methods with this annotation.