![]() |
subject > component > module > Java module > Java method > Java class method |
![]() ![]() | ||||
Java class method | ||||
subject | fact |
Java class method | does not have 'this' value when it is executing | ![]() |
is a subtopic of The Basics of Java | ![]() | |
is called by using the name of the class, followed by a dot, followed by the name of the method (the name of the class can be omitted when calling a class method in the current class) | ![]() | |
is marked as static | ![]() | |
is a kind of class method | ![]() | |
is a kind of Java method | ![]() | |
class method | has purpose implementing functions such as initializing a class, or operating on the complete set of instances of a class | ![]() |
should not be overused | ![]() | |
Java method | can be accessed by other methods and variables in any class in the same package by default | ![]() |
overrides a method in a superclass with the same name | ![]() | |
should be as private as possible | ![]() | |
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 | ![]() | |
procedural abstraction | has advantage when using a certain procedure, a programmer does not need to worry about all the details of how it performs its computations; he or she only needs to know how to call it and what it computes | ![]() |
hides the details of procedures | ![]() | |
procedure | provides procedural abstraction | ![]() |
module | has high cohesion if related aspects of a system are kept together in this module, and unrelated aspects are kept out | ![]() |
is implemented | ![]() | |
lacks 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 | ![]() | |
component | may perform a special-purpose function such as the user interface for a particular system | ![]() |
Kinds of Java class method :
Up: class method, Java method