OOP Flashcards

1
Q

OOP

A

Object-oriented programming (OOP) attempts to group information, data and code into structured items known as objects.

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

difference between object and class

A

A class is a blueprint for declaring and creating objects while an object is a class instance that allows programmers to use methods from inside the class.

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

Attributes

A

Data stored inside a class or object.

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

Methods

A

A set of instructions that complete a task, associated with an object

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

Encapsulation

A

Encapsulation is the bundling of data with the methods that operate on and restrict direct access to it.
It is used to hide the values or internal state of an object, preventing direct access by unauthorised parties

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

Inheritance

A

allows a class (called a subclass or derived class) to inherit all the methods and attributes of another class (called a superclass or base class) which can have its own additional properties.

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

Information hiding

A

the process of ​hiding all details of an object that do not contribute to its essential characteristics​.

Private Members: Some programming languages provide mechanisms to designate certain attributes or methods as “private,” meaning they can only be accessed within the same class or object. This prevents external code from directly manipulating or accessing these internal details.

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

Polymorphism

A

means objects can behave differently depending on their class.
This can result in the same method producing different outputs depending on the object involved.

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

Overriding (dynamic polymorphism)

A

redefining a method within a subclass and altering the code so that it functions differently and produces a different output.

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