Object Oriented Languages Flashcards

1
Q

Class

A

Template defining the attributes and methods that can be used to create a type of data known as an object.

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

What does Encapsulation do?

A

It protects attributes from being directly accessed.

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

How is encapsulation implemented?

A

By only allowing class methods to access data in an object’s attributes.

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

Inheritance

A

The concept of subclasses inheriting the methods and attributes of its parent class.

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

Method

A

A program subroutine that represents an action an object can perform.

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

Object

A

An instance of a class, with a set of methods and attributes.

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

Polymorphism

A

A property of OOP that 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
8
Q

What is good about object oriented programming?

A
  • Allows for a high level of reusability. This is good for projects where there are multiple components with similar properties (thanks to inheritance and polymorphism)
  • Classes can be used across multiple projects.
  • Encapsulation makes code more reliable by protecting attributes from being directly accessed
  • Modular structure makes it easy to maintain and update
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is bad about OOP?

A
  • Requires alternative style of thinking as it is a different style of programming.
  • Unsuitable for smaller programs
  • Where few components are reused, OOP may result in a longer more inefficient program.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Setter

A

A method that sets the value of a particular attribute.

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

Getter

A

A method which retrieves the value of a given attribute.

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

Why use getters and setters?

A

To ensure attributes cannot be directly edited and accessed.

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

How is encapsulation implemented?

A

By only allowing class methods to access data in an object’s attributes.

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

Constructor

A

Creates an instance of a class.

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

Instantiation

A

The process of creating an object.

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