Topic 5: Object-Oriented Programming (OOP)

0.0(0)
studied byStudied by 0 people
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/15

flashcard set

Earn XP

Description and Tags

Class & Object, Inheritance, Polymorphism, Abstraction, và Encapsulation

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

16 Terms

1
New cards

Q: What is Object-Oriented Programming (OOP)?

OOP is a programming paradigm based on the concept of objects, which contain data (fields) and methods (functions) to manipulate that data.

2
New cards

Q: What are the main principles of OOP?

The five main principles are: Encapsulation, Inheritance, Polymorphism, Abstraction, and Class & Object.

3
New cards

Q: What is Class & Object in OOP?

A class is a blueprint for creating objects. An object is an instance of a class, containing actual data and methods.

4
New cards

Q: What is Encapsulation in OOP?

Encapsulation is the concept of hiding the internal details of an object and only exposing necessary functionalities through public methods.

5
New cards

Q: What is Inheritance in OOP?

Inheritance is the mechanism by which one class can inherit the properties and behaviors of another class.

6
New cards

Q: What is Polymorphism in OOP?

Polymorphism is the ability for different classes to be treated as instances of the same class through inheritance, allowing one method to act in different ways.

7
New cards

Q: What is Abstraction in OOP?

Abstraction is the concept of hiding the implementation details and showing only the essential features of an object.

8
New cards

Q: What is a class in OOP?

A class is a blueprint or prototype for creating objects, specifying what data and behaviors the objects will have.

9
New cards

Q: What is an object in OOP?

An object is an instance of a class. It contains data (fields) and methods (functions) to perform operations on that data.

10
New cards

Q: What is the difference between a class and an object?

A class is a blueprint, while an object is an instance of that blueprint with actual data.

11
New cards

Q: What are constructors in Java?

Constructors are special methods that are called when an object is created. They initialize the object's state.

12
New cards

Q: What is method overloading in Java?

Method overloading is defining multiple methods with the same name but different parameter lists.

13
New cards

Q: What is method overriding in Java?

Method overriding is defining a method in a subclass with the same signature as a method in the superclass, allowing the subclass to provide a specific implementation.

14
New cards

Q: What is the 'super' keyword in Java?

The 'super' keyword is used to refer to the superclass's members (fields and methods) from the subclass.

15
New cards

Q: What is the 'this' keyword in Java?

The 'this' keyword refers to the current object instance of the class.

16
New cards