Accessor Methods Are Also Known As
A mutator method has no control over the way that a class's data attributes are modified.
False
Accessor methods are also known as
getters
All class definitions are stored in the library so that they can be imported into any program.
false
All instances of a class share the same values of the data attributes in the class.
false
Combining data and code in a single object is known as
encapsulation
In a UML diagram the first section holds the list of the class's methods.
false
In object-oriented programming, one of first tasks of the programmer is to
identify the classes needed
Mutator methods are also known as
setters
Object-oriented programming allows us to hide the object's data attributes from code that is outside the object.
true
Procedures operate on data items that are separate from the procedures.
true
The procedures that an object performs are called
methods
The 'self' parameter is required in every method of a class.
true
What does the acronym UML stand for?
Unified modeling language
What is the special name given to the method that returns a string containing an object's state?
__str__
What type of method provides a safe way for code outside a class to retrieve the values of attributes, without exposing the attributes in a way that could allow them to be changed by code outside the method?
accessors
What type of programming contains class definitions?
object-oriented
When an object is passed as an argument, ________ is passed into the parameter variable.
a reference to the object
Which attributes belong to a specific instance of a class?
instance
Which is the first line needed when creating a class named Worker?
class Worker:
Which method is automatically called when you pass an object as an argument to the print function?
__str__
Which method is automatically executed when an instance of a class is created in memory?
__init__
Which of the following can be thought of as a self-contained unit that consists of data attributes and the methods that operate on the data attributes?
an object
Which of the following will create an object, worker_joey, of the Worker class?
worker_joey = Worker()
Which section in the UML holds the list of the class's data attributes?
second section
Which section in the UML holds the list of the class's methods?
third section