![]() |
member > method |
![]() ![]() | ||||
method (function, member function) | ||||
subject | fact |
method | is a synonym of function | ![]() |
is a synonym of member function | ![]() | |
![]() | ![]() | |
| ![]() | |
![]() | ||
![]() | ||
![]() | ||
belongs to a class ![]() | ![]() | |
can access all instance variables of all objects of its class | ![]() | |
can be inherited by subclasses of its class ![]() | ![]() | |
can be accessed by other methods and variables in any class in the same package by default ![]() | ![]() | |
can have an array as a parameter - see method parameter ![]() | ![]() | |
can use the super method to invoke a method declared in the superclass | ![]() | |
cannot be passed as an argument to a method or constructor ![]() | ![]() | |
creates an object by instantiating a class | ![]() | |
has definition A concrete implementation of an operation; a procedure in a class ![]() | ![]() | |
has definition A procedural abstraction used to implement the behaviour of a class ![]() | ![]() | |
has definition A function defined in a class | ![]() | |
has definition Code that specifies some of the behaviour of a class or instance | ![]() | |
does not return a value if it has a void return type | ![]() | |
has part method definition | ![]() | |
has part method signature | ![]() | |
has part a block of implementation code | ![]() | |
implements | ![]() | |
is equivalent to the terms "function member" or "member function" which are used in C++ ![]() | ![]() | |
is equivalent to the terms "routine", "function" or "method" which are used in non object-oriented programming languages ![]() | ![]() | |
is part of a class or an object | ![]() | |
is a subtopic of Methods | ![]() | |
is partitioned into static method, instance method ![]() | ![]() | |
is a kind of access unit | ![]() | |
is a kind of member | ![]() | |
is a kind of specification | ![]() | |
may contain empty return statement if it has a void return type ![]() | ![]() | |
may have access modifier | ![]() | |
must contain return statement unless it has a void return type ![]() | ![]() | |
must define its parameter list | ![]() | |
must define its return type | ![]() | |
overrides a method in a superclass with the same name | ![]() | |
returns a value that is of the return type of the method or a subtype of that type ![]() | ![]() | |
should be as private as possible | ![]() | |
should have a comment at its head if the method is non-obvious | ![]() | |
should not be public except for those that will definitely need to be called from outside the package ![]() | ![]() | |
should return to its caller from only one place which should be the last statement ![]() | ![]() | |
usually hides instance variables, class variables from other objects | ![]() | |
access unit | has access mode | ![]() |
syntactic unit | has syntax rule bold = mandatory | ![]() |
Kinds of method :
Next access unit: variable Up: access unit, member, specification Previous access unit: interface