Subject |
refer to |
lack |
be |
return to |
is a kind of |
is a subtopic of |
have example |
have return type |
override |
perform |
access by |
has part |
has definition |
declare |
have high cohesion |
instance method | | | equivalent to the terms "routine", "function" or "procedure" which are used in non object oriented languages | | method | 2.4 - Methods, Operations and Polymorphism | | | | | | | A method that executes in the context of a particular object; it has access to the instance variables of the given object, and can refer to the object itself using the 'this' keyword (in Java and C++) | | |
Java method | | side effects if it does not modify any data, and does not leave behind any information, other than its result, that would have an effect on other computations | public except for those that will definitely need to be called from outside the package | its caller from only one place which should be the last statement | method | 9.1 - The Process of Design | | | a method in a superclass with the same name | a special-purpose function such as the user interface for a particular system | other methods and variables in any class in the same package by default | | | | if related aspects of a system are kept together in this module, and unrelated aspects are kept out |
Java instance method | the object itself using the 'this' keyword | side effects if it does not modify any data, and does not leave behind any information, other than its result, that would have an effect on other computations | public except for those that will definitely need to be called from outside the package | its caller from only one place which should be the last statement | Java method | The Basics of Java | public float credit(float amountToCredit) { balance = balance + amountToCredit; return balance; } | void if it does not return anything | a method in a superclass with the same name | a special-purpose function such as the user interface for a particular system | other methods and variables in any class in the same package by default | return type | | public, protected or private | if related aspects of a system are kept together in this module, and unrelated aspects are kept out |