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 : What is Timeslice Timeslice : It is the

    Timeslice: It is the amount of running time assigned to a process or thread prior to the scheduler considers the other to be run. The process or thread will not be capable to employ its full allocation of time when it becomes blocked or preempted thro

  • Q : Functions of states of the

    Mention the different states of the XMLHttpRequest an dalso describe their functions.

  • Q : What is Central Processing Unit Central

    Central Processing Unit: The Central Processing Unit (that is, CPU) is the heart of a computer as it is the portion that includes the computer's capability to follow instructions. Each kind of CPU has its own instruction set.

  • Q : Explain the reason to not carry on

    Explain the reason to not carry on extending HTML.

  • Q : Define Number of Threads Number of

    Number of Threads: Threads can be a useful abstraction and implementation mechanism to partition independent program actions. However, when there is coordination (or interference) between these threads, the required synchronization mechanisms increase

  • Q : What is an Arithmetic expression

    Arithmetic expression: It is an expression comprising numerical values of integer or floating point kinds. For example, operators like +, -, *, / and % get arithmetic expressions as their operands and generate arithmetic values as their outcomes.

  • Q : Define Swapping Swapping : An

    Swapping: An {operating system} is frequently able to run programs which need more memory than is physically accessible on the host system. In order to do this, the complete memory needed is broken down into smaller pieces that are swapped in whenever

  • Q : What is Random Access Memory Random

    Random Access Memory: Random access memory, or RAM, is the memory whose contents are simply accessible to the processing components of a computer. In specific, the time it takes to read and write to a particular portion of the memory does not based on

  • Q : Explain Parallel programming Parallel

    Parallel programming: It is a style of programming in which statements are not essentially executed in an ordered series but in parallel. The parallel programming languages make it simpler to produce programs which are designed to be run on multi-proc

  • Q : What is Shortcut key Shortcut key : A

    Shortcut key: A key-press related with a component in a Graphical User Interface (abbreviated as GUI) which provides an alternative to choosing the component's operation with mouse.

©TutorsGlobe All rights reserved 2022-2023.