Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

1) Acessor and mutators are A. instance variables of a class B. used to access a

ID: 2905853 • Letter: 1

Question

1) Acessor and mutators are

A. instance variables of a class

B. used to access and modify field variables of a class from outside the class

C. constructor methods

2) Accessor methods typically take

A. no parameter

b. one parameter, of the same type as the corresponding field

3) When coding a method that peforms calculations on fields of that classs,

a. these fields must be passed as parameter to the method

b. these fields do not need to be passed as parameters to the methods because the class methods have direct access to them

Explanation / Answer

    1    Acessor and mutators are

   An accessor is a method that accesses the contents of an object but does not modify that object.

       Hence ,these are used to access and modify field variables of a class from outside the class

       Option B is Correct

2) Accessor methods typically take

        These methods do not have a return type and accept a parameter that is the same data type as their corresponding private field.

    Hence , Accessor methods typically take no parameter

   Option A   is correct

3)