Java Reference
In-Depth Information
•
annotations
Annotations and annotation types are discussed in
•
access modifiers
These were discussed on page
47
.
•
abstract
An
abstract
method is one whose body has not been
defined in this classthe body is specified as a semicolon after the
parameter list. A subclass is then responsible for providing a body
for this method. This is discussed in
Section 3.7
on page
97
.
•
static
This is discussed below.
•
final
A
final
method cannot be overridden in a subclass. This is
discussed in
Section 3.6
on page
96
.
•
synchronized
A
synchronized
method has additional semantics re-
lated to the control of concurrent threads within a program. This
is discussed in
Section 14.3
on page
345
.
•
native
This is discussed in
Section 2.11
on page
74
.
•
strict floating point
A method declared
strictfp
has all floating-
point arithmetic evaluated strictly. If a method is declared within
a class declared
strictfp
, then that method is implicitly declared
strictfp
. See
Section 9.1.3
on page
203
for details.
An abstract method cannot be static, final, synchronized, native, or
strict. A native method cannot be strict.
When multiple modifiers are applied to the same method declaration,
we recommend using the order listed.
2.6.1. Static Methods
A
static
method is invoked on behalf of an entire class, not on a specific
object instantiated from that class. Such methods are also known as
class methods.
A
static
method might perform a general task for all ob-