--%>

Explain Mutator method

Mutator method: It is a method specifically designed to permit controlled modification of a private attribute of a class. By convention, we name the mutators with a set prefix obeyed by the name of the attribute being transformed. For example, the mutator for an attribute named speed would be setSpeed. By creating an attribute private, we save objects of other classes from modifying its value other than via its mutator. The mutator is capable to check the value being employed to transform the attribute and reject the modification when essential. Moreover, modification of one attribute may need others to be transformed in order to keep the object in a reliable state. A mutator technique can undertake this role. Mutators are employed both to grant safe access to the value of the private attribute and to save attributes from modification by objects of the other classes. The later goal is accomplished by selecting a suitable visibility for the mutator.

   Related Questions in Programming Languages

  • Q : Explain Redundant value Redundant value

    Redundant value: The value of a data type which has no use or meaning in a particular context. For example, negative values would be redundant a class employing integer attributes to the model assignment marks. In several applications, redundant patte

  • Q : Advantages of Object oriented

    Q. What are the advantages of Object Oriented Programming languages? Explain them. Ans. : Object oriented programming language has following advantages-

    Q : What is Unique Identifier What is

    What is Unique Identifier and how do I determine one?

  • Q : Where must I utilize XML Where must I

    Where must I utilize XML?

  • Q : Explain the way to start a Web Service

    Explain the way to start a Web Service.

  • Q : Define the term Host system Define the

    Define the term Host system: It is a computer system on which a process is executed or run.

  • Q : State the term URL path State the term

    State the term URL path?

  • Q : How can Login dialog accessed The web

    The web page I am testing displays the Login dialog. How can I access this dialog?

  • Q : Explain Switch statement Switch

    Switch statement: It is a selection statement in which the value of an arithmetic expression {expression!arithmetic} is compared for the match alongside different case labels. When no match is found, the optional default label is chosen For example:

  • Q : Java program to sort ten numbers using

    Q. Write a java program to sort ten numbers using bubble sort method. Ans. class Bubble sort

    Discover Q & A

    Leading Solution Library
    Avail More Than 1440360 Solved problems, classrooms assignments, textbook's solutions, for quick Downloads
    No hassle, Instant Access
    Start Discovering

    18,76,764

    1941169
    Asked

    3,689

    Active Tutors

    1440360

    Questions
    Answered

    Start Excelling in your courses, Ask an Expert and get answers for your homework and assignments!!

    Submit Assignment

    ©TutorsGlobe All rights reserved 2022-2023.