object oriented programming Flashcards

1
Q

class

A

A ​class ​is a​ template for an object​ and defines the ​state and behaviour of an object

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
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
3
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
4
Q

Information hiding

A

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

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

information hiding

private members

A

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
6
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.
  • Encapsulated attributes of an object should only be accessible or changeable via the methods provided by the object.
    *
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
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. This concept allows programmers to effectively reuse certain components and properties while making some changes.

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.
There are two categories of polymorphism: overriding and overloading.

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

polymorphism

overiding

A

Overriding (dynamic polymorphism) is 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
10
Q

polymorphism

overloading

A

Overloading (static polymorphism) is passing in different parameters into a method.

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