1.2.4 Flashcards

(11 cards)

1
Q

Define a class

A

Template for an object
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

Define attributes

A

Gives an object properties

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

Define methods

A

They define the behaviour associated with a class that describe actions it can perform

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

Define a setter

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
5
Q

Define a getter

A

A method that retrieves the value of a given attribute

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

Define encapsulation

A

Preventing attributes being directly accessed and edited
Attributes are declared as private so can only be altered by public methods

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

Define a constructor

A

Allows a new object to be created

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

Define inheritance

A

Subclass possesses all the methods and attributes of the superclass and can have its own additional properties

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

Define polymorphism

A

Objects can behave differently depending on their class
Same method can produce different outputs

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

Define overriding

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
11
Q

Overloading

A

Passing in different parameters into a method

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