Java   View all facts   Glossary   Help
member > method > accessor method > set method
Next accessor methodget method    Upaccessor method

set method
(mutator, setter)
subjectfact 
set methodis a synonym of mutator2001-10-19 11:37:27.0
has definition a method that assigns a value to an instance variableadded by: JK, source: On To Java, 2001-10-19 11:37:52.0
has definition A method which changes the state of an objectcomment: applies to the state of a class too?, added by: WH, source: T24e Glossary, 2001-10-19 11:37:52.0
is a subtopic of Methods2001-10-19 11:37:52.0
is named using "set" in its name by conventionadded by: JK, source: On To Java, 2001-10-19 11:37:52.0
is a kind of accessor methodadded by: WH, 2001-10-19 11:37:52.0
is a synonym of setter2001-10-19 11:37:53.0
accessor methodallows you to include additional computation, for example writing out a message2001-10-19 11:35:59.0
can provide access to imaginary instance variable that exist only in the sense that their values can be computed from instance variables that do exist2001-10-19 11:35:59.0
facilitates data abstraction    2001-10-19 11:35:59.0
should be provided if you anticipate that the detailed definition of a class may change because this will isolate the effects of potential changes    2001-10-19 11:36:00.0
method    2001-10-19 11:37:21.0
2001-10-19 11:37:21.0
2001-10-19 11:37:21.0
2001-10-19 11:37:21.0
2001-10-19 11:37:21.0
belongs to a class    2001-10-19 11:37:21.0
can access all instance variables of all objects of its class2001-10-19 11:37:21.0
can be inherited by subclasses of its class    2001-10-19 11:37:21.0
can be accessed by other methods and variables in any class in the same package by default    2001-10-19 11:37:21.0
can have an array as a parameter - see method parameter    2001-10-19 11:37:21.0
can use the super method to invoke a method declared in the superclass2001-10-19 11:37:21.0
cannot be passed as an argument to a method or constructor    2001-10-19 11:37:22.0
creates an object by instantiating a class2001-10-19 11:37:22.0
does not return a value if it has a void return type2001-10-19 11:37:22.0
has part method definition2001-10-19 11:37:22.0
has part method signature2001-10-19 11:37:22.0
has part a block of implementation code2001-10-19 11:37:22.0
implements 2001-10-19 11:37:22.0
is equivalent to the terms "function member" or "member function" which are used in C++    2001-10-19 11:37:22.0
is equivalent to the terms "routine", "function" or "method" which are used in non object-oriented programming languages    2001-10-19 11:37:22.0
is part of a class or an object2001-10-19 11:37:22.0
may contain empty return statement if it has a void return type    2001-10-19 11:37:22.0
may have access modifier 2001-10-19 11:37:22.0
must contain return statement unless it has a void return type    2001-10-19 11:37:22.0
must define its parameter list2001-10-19 11:37:22.0
must define its return type2001-10-19 11:37:22.0
overrides a method in a superclass with the same name2001-10-19 11:37:22.0
returns a value that is of the return type of the method or a subtype of that type    2001-10-19 11:37:22.0
should be as private as possible2001-10-19 11:37:22.0
should have a comment at its head if the method is non-obvious2001-10-19 11:37:22.0
should not be public except for those that will definitely need to be called from outside the package    2001-10-19 11:37:22.0
should return to its caller from only one place which should be the last statement    2001-10-19 11:37:23.0
usually hides instance variables, class variables from other objects2001-10-19 11:37:23.0
access unithas access mode2001-10-19 11:35:59.0
syntactic unithas syntax rule
bold = mandatory
italic = non-terminal
normal font = optional
2001-10-19 11:38:04.0

Next accessor methodget method    Upaccessor method