Question: EASY PYTHON Multiple Choice QUESTIONS 1a) What is the purpose of a constructor? To specify the public interface To identify the accessor and mutator methods
EASY PYTHON Multiple Choice QUESTIONS
1a) What is the purpose of a constructor?
| To specify the public interface |
| To identify the accessor and mutator methods |
| To define and initialize the instance variables of an object |
| To print the contents of an object |
1b) An object is a(n) .
| blueprint |
| variable |
| instance
|
1c) Which statement is NOT a description of encapsulation?
| The act of hiding the implementation details |
| A collection of methods through which the objects of the class can be manipulated |
| Mechanism for restricting access to some of the object's components |
| Encapsulation refers to the combining of data and code into a single object. |
1d) What is the purpose of an object's instance variables?
| Store the data required for executing its methods |
| To provide access to the data of an object |
| To create variables with public visibility |
1e) What is the purpose of a method?
| To access the instance variables of the object on which it acts |
| Store the data for all objects created by the same class |
| Provide comments about the program implementation |
1f) What is the purpose of the self parameter?
| To create variables with public visibility |
| Store the data for all objects created by the same class |
| Refers to the object on which the method was invoked
1g) By doing this, you can hide a classs attribute from code outside the class.
1h) A method that changes the object on which it operates is known as a(n):
|
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
