1/24
Name | Mastery | Learn | Test | Matching | Spaced | Call with Kai |
|---|
No analytics yet
Send a link to your students to track their progress
Abstraction
Focusing on what an object/class does and how to use it, while hiding the internal details of how it works.
Interface (public-facing API sense)
The set of public methods a class exposes that tells other code what operations can be performed (not necessarily the Java interface keyword).
Implementation
The private fields and internal logic that make a class work; hidden behind the class’s public methods.
Encapsulation
Bundling data with the methods that operate on it inside a class, while restricting direct access to the data (often using private fields).
Cognitive load (in program design)
The amount of detail a programmer must keep in mind; abstraction reduces it by letting you think in terms of method calls instead of internal steps.
Localization of change
A design benefit where changes to how something works are mostly confined to one class/module, without rewriting code that uses it.
Class invariant
A rule about an object’s state that should always be true (e.g., balance is never negative), enforced by constructors and methods.
High cohesion
A design goal where a class has a single, clear responsibility and its methods/fields strongly relate to that one purpose.
Responsibility (of a class)
The specific job or role a class is meant to handle (what it should do and what it should not do).
Representation (internal state choice)
How a class stores its data internally (e.g., storing total+count vs storing an average); should be hidden from users of the class.
Leaking representation
When outside code depends on a class’s internal storage details, making future implementation changes likely to break other code.
API (Application Programming Interface)
The “remote control” of a class: the methods and behavior other code is intended to call and rely on.
Field (instance variable)
A variable stored in an object that remembers state between method calls; each object has its own copy of instance fields.
Constructor
A special class member (same name as the class, no return type) that initializes a new object into a valid starting state.
Default no-argument constructor
A constructor Java provides automatically only if you define no constructors at all; it takes no parameters.
Overloaded constructor
One of multiple constructors in the same class with different parameter lists, allowing different ways to initialize objects.
Constructor chaining (this(…))
Calling one constructor from another using this(…), which must be the first line of the constructor, to avoid duplicated initialization logic.
Accessor method (getter)
A method that returns information about an object without changing its state (e.g., getScore()).
Mutator method (setter/modifier)
A method that changes an object’s state; a key place to enforce class invariants (e.g., prevent negative values).
this reference
A reference to the current object inside an instance method/constructor; often used to distinguish fields from parameters.
Shadowing
When a parameter/local variable has the same name as a field; without using this.fieldName, assignments may not affect the field.
Method signature
A method’s name plus its parameter types (and order); used by Java to distinguish overloaded methods.
Overloading (methods)
Defining multiple methods with the same name but different parameter lists; changing only return type does not overload.
Static member
A field or method that belongs to the class itself (shared across all objects); static methods do not have access to this.
Modularity
Building a program from well-defined parts (often classes) with clear boundaries, limited dependencies, and changeable internals.