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();
2
Q
True or False? A class may have more than one constructor.
A
True
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’.
4
Q
In which order should the elements in a UML class diagram appear?
A
Class Name, Attributes, Operations
5
Q
What is another word for ‘an instance of a class’?
A
An Object