6.1
Declarations
NAMES
be accessed anywhere within the package that contains its declaration; other pos
sibilities are
public
,
protected
, and
private
.
Fully qualified names ( 6.7) and naming conventions ( 6.8) are also dis
cussed in this chapter.
The name of a field, parameter, or local variable may be used as an expression
( 15.13.1). The name of a method may appear in an expression only as part of a
method invocation expression ( 15.11). The name of a class or interface type may
appear in an expression only as part of a class instance creation expression
( 15.8), an array creation expression ( 15.9), a cast expression ( 15.15), or an
instanceof
expression ( 15.19.2), or as part of a qualified name for a field or
method. The name of a package may appear in an expression only as part of a
qualified name for a class or interface type.
6.1 Declarations
A
declaration
introduces an entity into a Java program and includes an identifier
( 3.8) that can be used in a name to refer to this entity. A declared entity is one of
the following:
A package, declared in a
package
declaration ( 7.4)
An imported type, declared in a single type import declaration ( 7.5.1) or a
type import on demand declaration ( 7.5.2)
A class, declared in a class type declaration ( 8.1)
An interface, declared in an interface type declaration ( 9.1)
A member of a reference type ( 8.2, 9.2, 10.7), one of the following:
N
A field, one of the following:
O
A field declared in a class type ( 8.3)
O
A constant field declared in an interface type ( 9.3)
O
The field
length
, which is implicitly a member of every array type
( 10.7)
N
A method, one of the following:
O
A method (
abstract
or otherwise) declared in a class type ( 8.4)
O
A method (always
abstract
) declared in an interface type ( 9.4)
78
footer
Our partners:
PHP: Hypertext Preprocessor Best Web Hosting
Java Web Hosting
Inexpensive Web Hosting
Jsp Web Hosting
Cheapest Web Hosting
Jsp Hosting
Cheap Hosting
Visionwebhosting.net Business web hosting division of Web
Design Plus. All rights reserved