OOP Concepts Flashcards

1
Q

What is a Class?

A

A class is a blueprint or template for creating objects. It defines the properties (attributes) and behaviors (methods) that objects of the class will have.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is an Object?

A

An object is an instance of a class. It represents a real-world entity and has state (attributes) and behavior (methods) as defined by its class.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is Inheritance?

A

Inheritance allows a class (subclass or derived class) to inherit properties and behaviors from another class (superclass or base class).

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is Encapsulation?

A

Encapsulation is the bundling of data (attributes) and methods that operate on the data within a single unit, i.e., a class. It hides the internal state of an object and restricts access to certain components.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is Polymorphism?

A

Polymorphism allows objects of different classes to be treated as objects of a common base class.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is Abstraction?

A

Abstraction is the process of simplifying complex systems by modeling classes based on essential characteristics and ignoring non-essential details.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is Method Overloading?

A

In a class, multiple methods can have the same name but different parameter lists. This is known as method overloading.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is Method Overriding?

A

Inheritance allows a subclass to provide a specific implementation for a method that is already defined in its superclass.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is Association?

A

Relationship between two classes where one refers to another

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What is Aggregation?

A

Type of association where one class is composed of another, but can exist independently

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is Composition?

A

Stronger form of aggregation where one class ownes another class and has responsibility over it.

Owned class dependant on it.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What is Interface?

A

Collection of abstract methods. Classes that use an interface must provide concrete implementations for all the methods defined

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What is an Abstract Class?

A

A class that cannot be instantiated on its own

How well did you know this?
1
Not at all
2
3
4
5
Perfectly