1/99
Comprehensive practice flashcards covering static members, argument passing, object references, constructors, toString, object equality, aggregation, composition, copy constructors, shallow vs. deep copies, null references, this, enumerations, wrapper classes, autoboxing/unboxing, StringBuilder, tokenization, regular expressions, inheritance, overriding, super, protected access, polymorphism, dynamic binding, final methods, and the Object class.
Static Field
A class-level variable declared with the static keyword that belongs to the class itself rather than to any individual object instance; a single copy is shared across all instances of the class.
Instance Field
A non-static variable declared inside a class that belongs to a specific object instance, meaning every created object maintains its own independent copy and state.
Static Method
A method declared with the static keyword that belongs to the class rather than an object, meaning it can be invoked directly through the class name without instantiating an object.
Instance Method
A method that operates on the state of a specific object instance and requires an object to be instantiated before it can be invoked.

Static Member UML Representation
The standard notation in a UML class diagram where static fields and static methods are indicated by underlining their signatures.
Static Method Direct Access Rule
The Java language rule establishing that a static method can directly access static fields and other static methods, but cannot directly access instance fields or instance methods because no specific object instance exists in its context.
Pass-by-Value
Java's universal parameter-passing mechanism where the value stored in the argument variable is copied directly into the method's parameter variable, with zero exceptions.
Reference Variable
A variable whose stored value is a reference (an address-like value) that locates an object or array allocated on the heap, rather than holding the raw object data itself.
Passing an Array to a Method
An operation where a copy of an array's reference value is passed to a method, allowing the method to access and modify the elements of the caller's original array.
Array Parameter Reassignment
Assigning a newly instantiated array to an array parameter inside a method, which only updates the method's local copy of the reference and leaves the caller's original array untouched.
Returning an Object from a Method
A method mechanism where a reference value pointing to an object is returned to the caller, giving the caller access to the original object without copying the object itself.
Java Reference vs. C++ Pointer
A conceptual distinction where a Java reference identifies an object in memory without exposing actual physical addresses or permitting pointer arithmetic, unlike pointers in C/C++.
final static Field
A class constant loaded into class memory only once during execution whose assigned value cannot be altered or reassigned by any object or method.

Global State
A program condition created by excessive static variables where data is globally accessible and mutable across an entire runtime, making code difficult to test, reason about, and synchronize across threads.
Single Return Value Encapsulation
The technique of overcoming Java's single-return-value limitation by bundling multiple related values as fields within a single object and returning that object's reference.
Constructor
A special class member that has the exact same name as the class and no return type, automatically invoked when new creates an object to initialize instance fields into a valid starting state.
Default Constructor
A parameterless constructor provided automatically by the Java compiler only when a class contains no declared constructors, initializing fields to default values like zero, null, or false.
Parameterized Constructor
A constructor declared with parameters that accepts arguments during object creation to initialize instance fields with specific custom values.
Constructor Overloading
Declaring multiple constructors within the same class that share the class name but have different parameter lists, allowing objects to be initialized in different ways.
Constructor Return Type Mistake
The error of declaring a return type such as void on a constructor, which causes the Java compiler to interpret it as an ordinary method rather than a constructor.
== Operator with Objects
A relational operator that compares the reference values (memory addresses) of two object variables, evaluating to true only if both variables refer to the exact same object instance.
Default Object.equals() Method
The default equals implementation inherited from java.lang.Object that performs an identity comparison identical to the == operator by comparing object reference addresses.
Overriding equals(Object obj)
Writing a custom equals method in a class that compares the internal data fields of two objects of the same type to evaluate whether they represent identical information.
Logical Equality
The equivalence condition where two separate objects in memory are considered equal because their corresponding instance fields contain matching data.
Aliasing
The situation where two or more distinct reference variables hold identical reference values and therefore point to the exact same object on the heap.
Class-Specific copy() Method
An ordinary instance method written within a class that instantiates and returns a new object containing duplicate values of the calling object's instance fields.
Has-A Relationship
A design relationship where one class contains a reference to an object of another class as an instance field, commonly implemented via aggregation or composition.
Aggregation
A weaker has-a relationship where the contained object can exist independently of the containing object and may be shared among multiple containing instances.
Composition
A stronger has-a relationship representing whole-part ownership where the contained object is created and managed by the containing object and cannot exist independently of it.

Aggregation UML Notation
A relationship represented in a UML class diagram by a line with a hollow (unfilled) diamond attached to the containing class.
Composition UML Notation
A relationship represented in a UML class diagram by a line with a filled (solid black) diamond attached to the owning class.
Copy Constructor
A constructor that receives an existing object of the same class as a parameter and initializes a new object with duplicated field values from the source object.
Copy Constructor Syntax
The standard declaration format for a copy constructor, written as public ClassName(ClassName source), with no return type.
Copy Constructor vs. clone()
An industry design choice where copy constructors are preferred over clone() because copy constructors are type-safe, simple to implement, and avoid interface casting and default shallow copying issues.
Security Issue in Aggregate Constructors
A software vulnerability where an aggregate class constructor directly assigns an external object reference parameter to a private field, allowing external code to modify the class's private state.
Security Issue in Getter Methods
A vulnerability where an accessor method returns a direct reference to a private mutable object field, granting outside code direct access to mutate that private object.
Defensive Copying
The programming practice of creating copies of mutable objects when accepting them in constructors or returning them from accessors to protect a class's internal state from unauthorized external mutation.
Shallow Copy
An object-copying operation that duplicates the outer containing object but copies only the reference values of internal objects, leaving nested objects shared between both instances.
Deep Copy
An object-copying operation that duplicates the outer containing object and recursively creates brand new copies of all nested objects, ensuring complete operational independence.
null Literal
A special Java literal value indicating that a reference variable does not currently point to or identify any object in memory.
NullPointerException
A runtime exception thrown when a program attempts to invoke an instance method, access an instance field, or index an array using a reference variable that evaluates to null.
Default Value of Reference Fields
The default starting value automatically assigned by the Java virtual machine to any uninitialized instance or static object reference field, which is always null.
Null Checking
A defensive coding check (e.g., if (ref != null)) performed before invoking methods or accessing fields on an object reference to ensure it is not null.
this Keyword
A built-in Java reference variable available inside any instance method or constructor that refers directly to the current executing object.
Variable Shadowing
A condition where a constructor parameter or local variable shares the same identifier as an instance field, requiring the this. prefix to explicitly target the instance field.
this(…) Constructor Call
A special syntax used within a constructor to explicitly call another overloaded constructor in the same class, which must appear as the very first statement.
Enumeration (enum)
A specialized Java reference type that restricts a variable to hold only one constant from a fixed, predefined list of named values.
Enum Constant
An individual named identifier declared inside an enum type, written in uppercase letters by convention, that represents a distinct, immutable object instance.
values() Enum Method
A static method automatically provided for every enum that returns an array containing all declared constants of that enum type in the order of declaration.
ordinal() Enum Method
An enum instance method that returns the zero-based integer position of a constant within its enum declaration list.

Wrapper Class
A class that encapsulates a primitive data type into an object, providing utility methods and allowing primitives to be stored in object-only data structures.
compareTo() Enum Method
An enum method that compares the ordinal values of two constants of the same enum type, returning a negative integer, zero, or a positive integer.
Enum Equality with ==
The standard and safe practice of comparing enum constants using the == operator because Java guarantees that only one instance of each enum constant exists in memory.
Enum in switch Statements
The use of an enum variable as the control expression in a switch structure, where case labels specify bare constant identifiers without their enum class prefix.
Type Safety of Enums
A compile-time guarantee ensuring that an enum variable cannot be assigned misspelled strings, invalid integers, or out-of-range values.
Autoboxing
The automatic conversion performed by the Java compiler from a primitive data value into an instance of its corresponding wrapper class (e.g., int to Integer).
Unboxing
The automatic conversion performed by the Java compiler from an instance of a wrapper class back to its corresponding primitive value (e.g., Integer to int).
Wrapper Types in Generic Collections
The architectural requirement to use wrapper objects such as ArrayList
Character.isDigit(char ch)
A static method in the Character class that returns true if the specified char parameter represents a numeric digit ('0' through '9'), and false otherwise.
Character.isLetter(char ch)
A static method in the Character class that returns true if the specified char parameter represents an alphabetic letter, and false otherwise.
Character.isLetterOrDigit(char ch)
A static method in the Character class that returns true if the specified char parameter is an alphanumeric letter or digit, and false otherwise.
Character.isLowerCase(char ch)
A static method in the Character class that returns true if the specified char parameter is a lowercase letter, and false otherwise.
Character.isUpperCase(char ch)
A static method in the Character class that returns true if the specified char parameter is an uppercase letter, and false otherwise.
Character.isSpaceChar(char ch)
A static method in the Character class that returns true if the specified char parameter represents a space or whitespace character, and false otherwise.
String Immutability
The property of Java String objects stating that their contents cannot be modified after creation; any apparent modification creates an entirely new String object in memory.
StringBuilder Class
A standard Java library class representing a mutable sequence of characters that can be modified, appended, or altered in place without creating new objects.
Default StringBuilder Capacity
The initial character buffer capacity allocated by the no-argument constructor new StringBuilder(), which provides storage for 16 characters before needing automatic expansion.
StringBuilder.append()
An overloaded method that converts its argument to text and attaches it directly to the end of the calling StringBuilder sequence in place.
StringBuilder.insert()
An overloaded method that inserts data representations into a StringBuilder object at a specified zero-based index.
StringBuilder.deleteCharAt(int index)
A method that removes the single character located at the specified zero-based index from the StringBuilder object.
StringBuilder.setCharAt(int index, char ch)
A method that replaces the character at the specified zero-based index in a StringBuilder with the character ch.
StringBuilder.reverse()
A method that reverses the character sequence of a StringBuilder in place.
Tokenizing
The process of breaking a single string of delimited text into smaller, meaningful constituent parts known as tokens.
String.split(String regex, int limit)
A method that partitions a string around matches of a regular expression delimiter, returning a String[] array whose maximum element count is governed by the integer limit.
Regular Expression (RegEx)
A formatted string pattern that defines search criteria used for pattern matching, validation, and tokenizing in text.
RegEx Dot Metacharacter (.)
A regular expression metacharacter that matches any single character.
RegEx Anchors (^ and $)
Boundary metacharacters in regular expressions where ^ specifies a match at the beginning of a line and $ specifies a match at the end of a line.
RegEx Character Class ([abc])
A bracketed regular expression pattern that matches any single character appearing in the specified set ('a', 'b', or 'c').
RegEx Negated Character Class ([^abc])
A bracketed regular expression pattern starting with a caret that matches any character except those explicitly listed within the set.
RegEx Whitespace Pattern (\s+)
A regular expression pattern that matches one or more consecutive whitespace characters (spaces, tabs, newlines).
Inheritance
An object-oriented programming mechanism where a new class (subclass) automatically acquires fields and methods from an existing class (superclass), promoting code reuse.
Superclass
A general parent class that defines common fields and methods to be inherited and extended by specialized subclasses.
Subclass
A specialized child class that extends a superclass, inheriting its accessible members and adding or overriding fields and methods.
extends Keyword
The Java keyword placed in a class header to establish that the class inherits from and specializes a specified superclass.
Is-A Relationship
The core relationship modeled by inheritance, indicating that an instance of a subclass is a specialized kind of its superclass (e.g., a Dog is an Animal).
Code Duplication Elimination
A primary benefit of inheritance that centralizes shared attributes and behaviors in a superclass to eliminate repeated code across related subclasses.
Subclass Access to Superclass Private Fields
The rule that private members of a superclass are inherited in memory but cannot be accessed directly by name within subclass code, requiring public or protected accessors.
Generalization UML Arrow
The visual connector in UML class diagrams consisting of a solid line with an open (unfilled) triangular arrowhead pointing from the subclass to the superclass.
Method Overriding
The practice where a subclass defines an instance method with the exact same name, return type, and parameter list as an inherited superclass method to provide specialized behavior.
Method Overloading vs. Overriding
Overloading involves methods with the same name but different parameter signatures in a class; overriding involves a subclass rewriting an inherited method using the exact same signature.
@Override Annotation
A compiler directive placed above an overriding method instructing the Java compiler to verify that the method correctly overrides an existing method in a superclass.
super() Constructor Call
An explicit statement in a subclass constructor that invokes a constructor of its immediate superclass, which must appear as the very first line of code.
super.method() Invocation
Using the super keyword as a prefix within a subclass method to explicitly invoke the superclass's version of an overridden method.
protected Access Modifier
An access specifier declared with protected (represented by # in UML) that allows a class member to be accessed by subclasses and classes within the same package, but not by unrelated outside classes.
Polymorphism
The capability of a superclass reference variable to refer to objects of any derived subclass and automatically execute the appropriate subclass behavior at runtime.
Dynamic Binding
The runtime mechanism by which the Java Virtual Machine decides which overridden version of a method to execute based on the actual object type residing on the heap.
Polymorphism Rule #1 (Reference Type)
The rule dictating that the declared reference type determines which method names and member variables a program is permitted to call at compile time.
Polymorphism Rule #2 (Actual Object Type)
The rule dictating that at runtime, the actual object type instantiated on the heap determines which overridden implementation of a method is executed.
final Method
A method declared with the final keyword in a superclass that prevents any subclass from overriding it, guaranteeing that the superclass implementation remains unchanged.

Inheritance Hierarchy
A branching tree-like structure of classes linked by inheritance, tracing from general ancestor classes down to specific descendant subclasses.