Classes and UML Class Diagrams Flashcards

1
Q

Given a class called PayClaim (with no custom constructor), what is the correct way to create an instance of PayClaim?

A

PayClaim claim = new PayClaim();

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q
True or False?
A class may have more than one constructor.
A

True

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

If a method within a class has a parameter that shares a name with a variable in that same class, how can they be differentiated?

A

References to the variable should be prefixed with the keyword ‘this’.

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

In which order should the elements in a UML class diagram appear?

A

Class Name, Attributes, Operations

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

What is another word for ‘an instance of a class’?

A

An Object

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