____________ is ensuring that every object or module has a specific role
a. Separation of concerns
b. Encapsulation
c. Design by contract
d. Information hiding
a. Separation of concerns
_______________ is controlling access to data and operations.
a. Separation of concerns
b. Encapsulation
c. Design by contract
d. Information hiding
d. Information hiding
__________ is grouping related data and operations together in one object.
a. Separation of concerns
b. Encapsulation
c. Design by contract
d. Information hiding
b. Encapsulation
The precondition automatically checks and enforces itself by checking the value
of the parameter, and returning an error if it's outside of the parameters.
a. True
b. False
b. False
Who is responsible for making sure that the precondition for a function is met?
a. Implementer who codes the function
b. The client who calls the function
b. The client who calls the function
, Who is responsible for making sure that the postcondition for a function is met?
a. Implementer who codes the function
b. The client who calls the function
a. Implemented who codes the function
It is good practice to use an if statement inside the method to check to see if the
precondition of the method is met.
a. True
b. False
b. False
The standard documentation technique for Java is called
Javadoc
Which of the following is not a time when we would assume the invariant to be
true?
a. After the constructor has finished.
b. At the beginning of a public method
c. After a public method has finished
d. During the body of the public method or constructor
d. During the body of the public method or constructor
Who is responsible for making sure a class invariant is true?
a. The client who uses the class
b. The implementers of the class and its public methods
c. The implementers of the class's private methods
b. The implementers of the class and its public methods
It is a good idea to make data fields of a class public to make access to them
easier and avoid coding unnecessary getter and setter functions.
a. True
b. False
b. False
Which is the best design practice?
a. Provide getter and setter functions to allow access to data members
b. Make data member public for direct access