1. (TCO 2) _____ are special methods that have the same name as the class they a
ID: 3645653 • Letter: 1
Question
1. (TCO 2) _____ are special methods that have the same name as the class they are declared in and are used to initialize state of objects. (Points : 2)constructors
destructors
static methods
public methods
None of the above
2. (TCO 2) If a programmer does not explicitly define a _____, a default version will be provided by the compiler. (Points : 2)
destructor
method
constructor
attribute
All of the above
3. (TCO 2) Benefits of encapsulation include which of the following? (Points : 2)
Universal data access
Reduced data dependencies
Decrease in implementation time
Stable communication between applications
All of the above
4. (TCO 2) One of the ways object-oriented languages protect object data is through _____. (Points : 2)
integration of objects
universal data access
encapsulation
the public accessor
All of the above
5. (TCO 2) Which of the following symbols indicate level of access for both attributes and methods in a class? (Points : 2)
&&
/
-
||
All of the above
6. (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. (Points : 2)
interface; implementation
inputs; outputs
objects; accessors
relationships; interfaces
7. (TCO 2) In order to increase the quality of our code, _____ and information/data hiding should be considered when designing any object-oriented class. (Points : 2)
encapsulation
implementation
overloaded constructors
an object
Explanation / Answer
1. constructors 2. constructor 3. Stable communication between applications 4. encapsulation 5. - 6. objects; accessors 7. implementation 8. public: int getAge() { return age;} 9. public: void setAge(int age) {this->age = age;} 10. private: string getName(){return name;} 11. None of the above 12. All of the above 13. Encapsulation means hiding data in a class from other classes. 14. A set of characteristics and behaviors that define an object 15. A and B
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.