OOP Fundamentals

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/49

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.

50 Terms

1
New cards

Abstraction Definition

The ability to separate the interface from the implementation, hiding details and showing only what is necessary.

2
New cards

Abstraction (method example)

Putting code inside a method creates a new concept whose interface (name, inputs, outputs) is what matters.

3
New cards

Abstraction Levels

Methods → classes → packages represent increasing abstraction layers.

4
New cards

Abstraction Benefits

Higher readability, reusability, testability, maintainability, and simplification of complex systems.

5
New cards

Inheritance Definition

A two-way capability: (1) a child extends a parent (gains its features and adds more), and (2) common capabilities of children can be factored into a parent.

6
New cards

Inheritance is called an “__-_” relationship

Also called an “is-a relationship” in OOP.

7
New cards

Superclass

A more general class from which others inherit.

8
New cards

Subclass

A more specialized class that extends a superclass.

9
New cards

Default Parent in Java

Every class implicitly inherits from the Object class.

10
New cards

extends Keyword

Java keyword used to denote inheritance.

11
New cards

Inheritance Asymmetry

A manager is-an employee, but an employee is NOT necessarily a manager.

12
New cards

Method Overriding

Re-implementing an inherited method in the subclass.

13
New cards

Constructors and Inheritance

Constructors cannot be inherited or overridden because they are not class members.

14
New cards

UML Inheritance Connector

A solid line with a hollow triangle pointing to the superclass.

15
New cards

Visible Members That Are Inherited

All members visible according to access modifiers (public, protected, package).

16
New cards

super Keyword

Used to call superclass constructors and methods from a subclass.

17
New cards

Is Multiple Inheritance in Java supported?

Not supported for classes due to increased complexity.

18
New cards

What is a final Class?

A class that cannot be extended.

19
New cards

What is a final Method?

A method that cannot be overridden.

20
New cards

What is a final Attribute?

An attribute that cannot be changed after initialization.

21
New cards

Does Inheritance increase complexity?

Overusing inheritance increases complexity

22
New cards

Encapsulation Definition

Bundling attributes and behaviors in a class while controlling their visibility.

23
New cards

Encapsulation Abilities

Control access levels—read-only, write-only, read/write, or hidden.

24
New cards

Encapsulation Benefits

Organizes code, protects data, controls external access, prevents accidental misuse.

25
New cards

Is encapsulation just data hiding?

Encapsulation is NOT just hiding—it also includes bundling and controlled access.

26
New cards

Mutable Object

An object whose state can change

27
New cards

Interface (general meaning)

The set of visible members of a class (its API).

28
New cards

Java Interface

A separate construct containing abstract methods and optional default/static methods.

29
New cards

interface Keyword

Used to declare a Java interface.

30
New cards

implements Keyword

Used by a class to implement an interface.

31
New cards

Interface Requirements for inheriting class

A class must implement all interface methods or compilation fails.

32
New cards

Interface Naming

Interfaces should have abstract, generic names (e.g., AnimalInt vs DogInt).

33
New cards

Interface Default Methods

Methods in an interface with implementation (allowed since Java 8).

34
New cards

Are Interface Constants allowed?

Must be public static final (often implied automatically).

35
New cards

Are Interface Instance Variables allowed?

Not allowed—interfaces cannot have state.

36
New cards

Interface-Class Relationship

A class implementing an interface “is-an” instance of that interface.

37
New cards

Interface UML Connector

Dashed line with hollow triangle pointing to the interface.

38
New cards

Interfaces Extending Interfaces

An interface may extend multiple interfaces.

39
New cards

Association (UML)

A general relationship indicating dependency, aggregation, or composition.

40
New cards

Polymorphism

The ability to assign/pass a child object to a parent reference, enabling behavior to be chosen at runtime.

41
New cards

Runtime Binding

Java determines which overridden method to call at runtime based on the actual object.

42
New cards

Why Polymorphism Exists

Allows code to handle new types with minimal changes, solving Change and Complexity.

43
New cards

Method Overloading Definition

Same method name but different parameter lists in the same class.

44
New cards

Method Overloading Uses

Allows multiple versions of a behavior tailored to different input types.

45
New cards

Dependency Reduction via Polymorphism

Code depends on one interface instead of many classes.

46
New cards

What does (A-PIE) stand for?

Abstraction, Polymorphism, Inheritance, Encapsulation.

47
New cards

Abstraction (A-PIE summary)

Separating interface from implementation.

48
New cards

Polymorphism (A-PIE summary)

Passing a child object to a parent reference at runtime.

49
New cards

Inheritance (A-PIE summary)

Extending or factoring common behavior across classes.

50
New cards

Encapsulation (A-PIE summary)

Bundling data + behaviors and controlling their visibility.