8
C H A P T E R
Classes
class 1. The noun
class
derives from
Medieval French and French
classe
from Latin
classis
,
probably originally a summons,
hence a summoned collection of persons,
a group liable to be summoned:
perhaps for
callassis
from
calare
,
to call, hence to summon.
Eric Partridge
Origins: A Short Etymological Dictionary of Modern English
C
LASS declarations define new reference types and describe how they are
implemented ( 8.1).
The name of a class has as its scope all type declarations in the package in
which the class is declared ( 8.1.1). A class may be declared
abstract
( 8.1.2.1)
and must be declared
abstract
if it is incompletely implemented; such a class
cannot be instantiated, but can be extended by subclasses. A class may be declared
final
( 8.1.2.2), in which case it cannot have subclasses. If a class is declared
public
, then it can be referred to from other packages.
Each class except
Object
is an extension of (that is, a subclass of) a single
existing class ( 8.1.3) and may implement interfaces ( 8.1.4).
The body of a class declares members (fields and methods), static initializers,
and constructors ( 8.1.5). The scope of the name of a member is the entire decla
ration of the class to which the member belongs. Field, method, and constructor
declarations may include the access modifiers ( 6.6)
public
,
protected
, or
private
. The members of a class include both declared and inherited members
( 8.2). Newly declared fields can hide fields declared in a superclass or superinter
face. Newly declared methods can hide, implement, or override methods declared
in a superclass or superinterface.
Field declarations ( 8.3) describe class variables, which are incarnated once,
and instance variables, which are freshly incarnated for each instance of the class.
127
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