Option D Paper 2 - OOP Vocab

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

1/31

Last updated 9:41 PM on 4/24/26
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai

No analytics yet

Send a link to your students to track their progress

32 Terms

1
New cards

Class

A blueprint or template that defines the state (variables) and behaviour (methods) that all objects of that type will have. No memory is allocated for a class itself — only for objects created from it.

2
New cards

Object

A specific instance of a class, created using the new keyword. Each object has its own copy of the instance variables but shares the same method definitions.

3
New cards

Instantiation

The process of creating an object from a class using the new keyword. This allocates memory for the object and calls the constructor.

4
New cards

Constructor

A special method that runs automatically when an object is created with new. It has the same name as the class and no return type. Used to initialise instance variables. Can be overloaded.

5
New cards

Instance Variable

A variable declared at class level (not inside a method). Each object gets its own independent copy. Almost always declared private.

6
New cards

Encapsulation

Bundling an object's data (attributes) and the methods that operate on that data into a single unit (the class), while hiding the internal details from outside code. Achieved using private fields and public getter/setter methods.

7
New cards

Accessor Method

A public method that returns the value of a private instance variable. Named getFieldName(). Takes no parameters and has a return type matching the field.

8
New cards

Mutator Method

A public method that sets the value of a private instance variable. Named setFieldName(). Takes one parameter and returns void. Can include validation logic.

9
New cards

“this” Keyword

A keyword that refers to the current object. Used inside a method or constructor to distinguish between an instance variable and a parameter with the same name.

10
New cards

Inheritance

A mechanism where a subclass (child) acquires all the attributes and methods of a superclass (parent). Declared with extends. Represents an 'is a' relationship. Java only allows single inheritance.

11
New cards

Superclass

The parent class in an inheritance relationship. Its attributes and methods are inherited by all subclasses. Also called base class or parent class.

12
New cards

Subclass

The child class in an inheritance relationship. It inherits all attributes and methods of its superclass and can add new ones or override existing ones. Declared with extends.

13
New cards

“extends” Keyword

The Java keyword used to declare that a class inherits from another class.

14
New cards

“super” Keyword

A keyword that refers to the superclass. Used in two ways: super() calls the superclass constructor (must be first line); super.method() calls the superclass version of an overridden method.

15
New cards

“@Override” Annotation

An annotation placed before a method to indicate it replaces a superclass method. The compiler checks the signatures match exactly. Not required but strongly recommended.

16
New cards

Polymorphism

The ability for objects of different classes to be treated as objects of a common superclass type. The method called depends on the actual type of the object at runtime, not the reference type. Two forms: overriding (runtime) and overloading (compile-time).

17
New cards

Overriding

When a subclass provides its own implementation of a method that already exists in the superclass. The method name, parameters, and return type must match exactly. Uses @Override annotation.

18
New cards

Overloading

When a class has multiple methods with the same name but different parameter lists (different number or types of parameters). The compiler picks the right one at compile-time.

19
New cards

“instanceof” Operator

An operator that tests whether an object is an instance of a specified class or its subclasses. Returns a boolean. Returns false if the object is null — never throws an exception.

20
New cards

Type Casting

Converting a superclass reference to a subclass type to access subclass-specific methods. Must be done explicitly with (SubclassName). Throws ClassCastException if the object is not actually that type.

21
New cards

Access Modifier

A keyword that controls the visibility of a class, field, or method. The three main ones in Java are public (+), private (-), and protected (#). Used in UML notation too.

22
New cards

“static” Keyword

A keyword indicating that a variable or method belongs to the class itself, not to any individual object. All objects share one copy of a static variable. Static methods cannot access instance variables.

23
New cards

“final” Keyword

A keyword that makes a variable constant — it can only be assigned once and cannot be changed. Convention: name constants in ALL_CAPS. Used to avoid 'magic numbers' in code.

24
New cards

“toString()” Method

A method inherited from the Object class. By default it returns a memory address string. Override it in your classes to return a meaningful text representation of the object.

25
New cards

“equals()” Method

A method inherited from the Object class. By default it compares memory addresses (same as ==). Override it to compare objects by their field values instead. Parameter MUST be Object.

26
New cards

UML Class Diagram

Unified Modelling Language visual notation for representing classes, their attributes, methods, and relationships. Each class is a box with three sections: name, attributes, methods. Visibility shown with +, -, # symbols.

27
New cards

Aggregation

A UML 'has a' relationship where the child can exist independently of the parent. Shown with a hollow diamond on the parent side. Weak ownership — the child's lifecycle is not controlled by the parent.

28
New cards

Composition

A UML 'part of' relationship where the child cannot exist without the parent. Shown with a filled diamond on the parent side. Strong ownership — child is created and destroyed with the parent.

29
New cards

Multiplicity

UML notation showing how many objects participate in a relationship. Written at each end of a relationship line.

30
New cards

Modularity

Designing a program as independent, interchangeable units (modules/classes) that can be developed, tested, and maintained separately. Each module has a clear, single responsibility.

31
New cards

Association

Association is a UML relationship representing a general "has a" or "uses a" connection between two classes, where both can exist independently of each other. It's the most basic relationship type — just a solid line between the two classes.

32
New cards

Dependency

A relationship where one class uses another class, typically temporarily — for example as a method parameter, a local variable, or a return type. It is shown in UML as a dashed arrow pointing from the class that depends on the other to the class being used.