Questions tagged [mutators]

Anything related to mutators (a.k.a. setters, or mutator methods) in object oriented programming, i.e. instance methods whose exclusive purpose is to change (part of) the internal state of an object to a specific value, without performing substantial additional processing.. This may also refer to mutator functions in non-OO languages when OOP techniques are used to emulate OOP-like encapsulation.

Overview

Anything related to mutators (a.k.a. setters, or mutator/setter methods) in Object Oriented Programming, i.e. instance methods whose exclusive purpose is to change (part of) the internal state of an object to a specific value, without performing substantial additional processing. This may also refer to mutator functions in non-OO languages when OOP techniques are used to emulate OOP-like encapsulation.

See also

217 questions
-2
votes
1 answer

making a class of Circle with constructors, accessors and mutators

im trying to create a class CircleClass but i have some errors that i cant get my head around. can i get help finding the errors? import java.util.*; public final class CircleClass { //class fields private int diameter; private double…
cheong kim
  • 21
  • 1
  • 7
-2
votes
5 answers

Java for loop and class definition

Hey im very new at java so please bear with me :) I have objects v1, v2, v3 with each one containing details of soccer players stats int LessThan25 = 0; for (int i = 0; i < topscorer.size(); i++) { while (v**[i]**.getGoals()…
DonD
  • 21
  • 2
-3
votes
2 answers

c++ accessors mutators not reading cin switch case statement

I am using Ubuntu terminal g++ compiler for this , its hard for me to debug Here is my code : S.h class S { protected: string name; bool space; public: S(); S(string,bool); void…
-3
votes
3 answers

Implementing a Demo/Tester Program

I have a project for my java programming course. The instructions are that we have to create a simple class and a tester class, and the class must include a Default constructor; Parameterized constructor with three parameters (make, model and…
J. Nav
  • 55
  • 1
  • 8
-3
votes
3 answers

Why does my Java code return a null value (accessors and mutators)?

I am trying to get this Accessor/ Mutator combo down and I'm having trouble with it. I'm learning java and this is one thing that I just cannot do. public class Airport extends mainClass { public String ID; //Accessor public String getID()…
-4
votes
4 answers

Constructor and no-argument constructor?

The following are the instructions and code for a Java program I have to complete. I am stuck and do not know how to continue. I'm trying to figure this out. I feel like I have no idea what I'm doing. All help, direction, and explanation would be…
IAmTheWalrus
  • 23
  • 2
  • 8
-5
votes
3 answers

Boolean in Mutator Method

I have a project in which I'm working on a class that has mutator and accessor methods. For my mutator methods, I have to return a boolean. "True - indicating the height is within range and that the Object's value has been modified." False,…
J. Nav
  • 55
  • 1
  • 8
1 2 3
14
15