Quiz 1 - Encapsulation, Inheritance, and Polymorphism

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

1/20

encourage image

There's no tags or description

Looks like no tags are added yet.

Last updated 10:48 AM on 4/9/26
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai

No analytics yet

Send a link to your students to track their progress

21 Terms

1
New cards

Object-Oriented Programming

What does OOP stands for?

2
New cards

Encapsulation

The principle of pushing data(fields) and methods that operate on that data into a single unit (class), while restricting direct access to the data by using access modifiers like private and exposing controlled access through public getter and setter methods. This ensures data hiding, security, and better maintainability.

3
New cards

Inheritance

An Object-Oriented Programming(OOP) concept where one class (child/subclass)acquires the properties and behaviors of another class(parent/superclass) using the extends keyword. This promotes code reusability, better organization, and allows polymorphism.

4
New cards

Polymorphism

In Java it means “many forms” — it allows the same method or object to behave differently depending on the context, typically through method overloading (compile-time polymorphism) and method overriding (runtime polymorphism). It’s one of the core principles of Object-Oriented Programming (OOP) that enables flexibility and code reuse.

5
New cards

Data Hiding

Class fields are declared private so they cannot be accessed directly from outside.

6
New cards

Controlled Access

Public methods (getters and setters) are provided to read or modify private fields.

7
New cards

Data Hiding and Controlled Access

Key points of Encapsulation

8
New cards

Benefits of Encapsulation

- Protects data integrity by controlling how values are set.

- Makes code easier to maintain and modify without breaking other parts.

- Improves readability and usability.

- Supports modular programming.

9
New cards

Customization and Polymorphism

Key points of Inheritance

10
New cards

Superclass (Parent/Base Class)

The class whose features are inherited.

11
New cards

Subclass (Child/Derived Class)

The class that inherits from the superclass.

12
New cards

Customization

Subclass can add new fields/methods or override existing ones.

13
New cards

Polymorphism

Enables writing flexible code where a parent reference can point to child objects.

14
New cards

Single, Multilevel, Hierarchical, and Hybrid

Types of Inheritance

15
New cards

Single Inheritance

One class inherits from another.

16
New cards

Multilevel Inheritance

A class inherits from a subclass (chain).

17
New cards

Hierarchical Inhertiance

Multiple classes inherit from one superclass.

18
New cards

Hybrid Inheritance

Combination of different types (not directly supported in Java due to ambiguity, but achievable via interfaces).

19
New cards

Compile-time (Method Overloading) and Runtime (Method Overriding)

Key points of Polymorphism

20
New cards

Compile-time Polymorphism (Method Overloading)

- Multiple methods with the same name but different parameter lists.

- Decided at compile time.

21
New cards

Runtime Polymorphism (Method Overriding)

- A subclass provides a specific implementation of a method already defined in its superclass.

- Decided at runtime based on the actual object type.