1. (TCO 2) Which of the following statements is/are true?
Object names are listed in the top section of a UML diagram.
Attribute names are listed in the top section of a UML diagram.
Method names are listed in the top section of a UML diagram.
Class names are listed in the top section of a UML diagram.
None of the above
2. (TCO 2) Java, C#, and C++ all allow for the use of comments. Which of the following statements are true regarding comments?
Comments may span only one line.
Comments may span one or more lines.
Comments must span more than one line.
None of the above
3. (TCO 2) _____ attributes are hidden from outside classes in order to prevent outside classes from arbitrarily changing their state.
Static
Private
Public
All of the above
4. (TCO 2) A(n) _____ has the same name as the class it is declared in, it is used to initialize attributes, and accepts zero arguments.
default destructor
default constructor
initializing method
instantiation
None of the above
5. (TCO 2) Benefits of encapsulation include which of the following?
Universal data access
Reduced data dependencies
Decrease in implementation time
Stable communication between applications
All of the above
6. (TCO 2) Which of the following symbols indicate level of access for both attributes and methods in a class.
&&
/
-
||
All of the above
7. (TCO 2) Object-oriented classes should be designed with the concept of a black box in mind. This means that users of the class should only need to know what _____ and _____ are associated with the class. The actual implementation details need not be known.
interface; implementation
inputs; outputs
objects; accessors
relationships; interfaces
8. (TCO 2) One of the benefits of _____ is that it allows the implementation of a class to change without affecting external entities using that class.
abstraction
encapsulation
instantiation
construction
9. (TCO 2) Which of the following is a proper implementation for a setter?
int setAge() { return age;}
void setAge(int age) {this.age = age;}
void setAge(int newAge) {return age;}
void setAge() {return age;}
10. (TCO 2) Identify the setter declaration(s) below that most likely contribute to the concept of information/data hiding.
private string setName(){this.name = name;}
public string setName(){this.name = name;}
public void setName(string name){this.name = name;}
private void setName(string name){this.name = name;}
None of the above