Question

A method used to change the value of an attribute of an object is called a/an...

A method used to change the value of an attribute of an object is called a/an

A. accessor (getter)

B. mutator (setter)

C. constructor

D. destructor

0 0
Add a comment Improve this question Transcribed image text
Answer #1

A method used to change the value of an attribute of an object is called a/an

B. mutator(setter)

Reason:

mutator are setters. A mutator is a method used to change the value of an attribute of an object. (answer)

accessor is method used to retrieve the value of an attribute of an object.

Constructor is member method of class which is used to initialize the variables of an object automatically when it is invoked.

destructor is a special member function which destructs or deletes an object.

Add a comment
Know the answer?
Add Answer to:
A method used to change the value of an attribute of an object is called a/an...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Define a public method that is called isPrime() that returns a boolean and implements the Sieve...

    Define a public method that is called isPrime() that returns a boolean and implements the Sieve of Eratosthenes method. Define a public method that is called numberOfPrimes() that returns the number of prime numbers between 2 and the private attribute value. Show this object in a main method that allows the user to interact with all the public methods of your class. Make a class called MyNumber with an integer private attribute. Make a constructor that defines an integer parameter...

  • Generics Objectives: OOWorking with a Generic Class 1. Create a class called Node that is Generic...

    java Generics Objectives: OOWorking with a Generic Class 1. Create a class called Node that is Generic. The class has one class attribute that is an element. It will need 2 Constructors, a setter and getter for the class attribute, and a toString method. 2. Write a Lab10Driver that will: Instantiate a Node Integer object with no value. I. Il. Ill. IV. a. Then call the set method to set the value to 5. Instantiate a Node String object with...

  • *Python* INTRODUCTION: The goal of this programming assignment is to enable the student to practice object-oriented...

    *Python* INTRODUCTION: The goal of this programming assignment is to enable the student to practice object-oriented programming using classes to create objects. PROBLEM DEFINITION: Write a class named Employee that holds the following data about an employee in attributes: name, IDnumber, department, jobTitle The class should have 8 methods as follows:  For each attribute, there should be a method that takes a parameter to be assigned to the attribute. This is known as a mutator method.  For each...

  • Java 3. Which type of method queries an object for information without changing it? A. A...

    Java 3. Which type of method queries an object for information without changing it? A. A constructor B. An accessor method C.A mutator method Which type of method modifies an object on which it operates? 1. The "new" method 2. An accessor method 3. A mutator method

  • PYTHON Task 1 Create a class called Window It has 2 public properties 1 private property...

    PYTHON Task 1 Create a class called Window It has 2 public properties 1 private property 1 constructor that takes 3 arguments pass each argument to the appropriate property Task 2 In a new file import the Window class Instantiate the Window object Output the two public properties Task 3 Alter the Window class in Task 1 Add an accessor and mutator (the ability to access and change) to the private property Task 4 Create a class named Instrument Give...

  • JAVA Create a Java project to implement a simple Name class. This class will have the...

    JAVA Create a Java project to implement a simple Name class. This class will have the following class variable: First Name, Middle Name, Last Name, and Full Name Create the accessor/getter and mutator/setter methods. In addition to these methods, create a toString() method, which overrides the object class toString() method. This override method prints the current value of any of this class object. Create a main() method to test your project.

  • Consider the class public elass Box·xtenda 0bJeetE private String stuff』 Write two constructors for the class....

    Consider the class public elass Box·xtenda 0bJeetE private String stuff』 Write two constructors for the class. The first constructor will take zero input arguments and set the stuff attibute to null. The second will take a String as input and set the shul atbute to input string Getter and Setter Write a public getter method called getsauff that returns the string stored by the sthuff attribute If stulf is null, it should return the string "no stuff in here Write...

  • Overload a relational operator for the Job class: Assume that this operator is not overloaded for...

    Overload a relational operator for the Job class: Assume that this operator is not overloaded for the Salary class. a) Write how the function will be declared in your code. b) Write an external function definition (not inside the class). solve it in C++10 to solve this you nedd question number 1. Create a composition between the classes Job and Salary. Class Salary a. data member:    1. money b. constructors:    1. default constructor    2. user defined constructor with a parameter...

  • A(n) _______ can typically modify the values of instance variables. a. mutator method b. accessor method...

    A(n) _______ can typically modify the values of instance variables. a. mutator method b. accessor method c. get method d. set method Choose the correct responses.  static methods can be _______. a. called only from other static methods b. called only when an object has been instantiated c. accessed through a reference to any object of the class if they are public d. called when no objects of the class have been instantiated.

  • Take the Pizza class from assignment # 1 and modify it in the following way: -...

    Take the Pizza class from assignment # 1 and modify it in the following way: - Rename it to DeluxePizza. - Add a stuffedWithCheese (boolean) attribute to the class. - Add a veggie Topping (integer) attribute to the class. This attribute keeps track of the number of vegetables toppings excluding mushrooms. Add a static attribute numberOfPizzas (integer) which will keep track of the number of DeluxePizza objects created Update the existing non-default constructor such that it increments the numberOfPizzas by...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT