Object Oriented Software Engineering   View all facts   Glossary   Help
subject > component > module > Java module > Java method > Java instance method
Upinstance method, Java method

Java instance method comparison table
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 method2.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 computationspublic except for those that will definitely need to be called from outside the packageits caller from only one place which should be the last statementmethod9.1 - The Process of Design  a method in a superclass with the same namea special-purpose function such as the user interface for a particular systemother 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 methodthe object itself using the 'this' keywordside 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 computationspublic except for those that will definitely need to be called from outside the packageits caller from only one place which should be the last statementJava methodThe Basics of Java
public float credit(float amountToCredit)
{
balance = balance + amountToCredit;
return balance;
}
void if it does not return anythinga method in a superclass with the same namea special-purpose function such as the user interface for a particular systemother methods and variables in any class in the same package by defaultreturn type public, protected or privateif related aspects of a system are kept together in this module, and unrelated aspects are kept out

Upinstance method, Java method