Q
: Using static import, can I import the static members of classes that
I create?
A
: Yes, you can use static import to import the static members of classes and
interfaces you create. Doing so is especially convenient when you define several
static members that are used frequently throughout a large program. For example,
if a class defines a number of static final constants that define various limits, then
using static import to bring them into view will save you a lot of tedious typing.
ANNOTATIONS (METADATA)
Java provides a feature that enables you to embed supplemental information into a
source file. This information, called an
annotation, does not change the actions of a
program. However, this information can be used by various tools, during both
development and deployment. For example, an annotation might be processed by a
sourcecode generator, by the compiler, or by a deployment tool. The term
metadata is
also used to refer to this feature, but the term annotation is the most descriptive, and
more commonly used.
Annotation is a large and sophisticated topic, and it is far beyond the scope of this book
to cover it in detail. However, an overview is given here so that you will be familiar with
the concept.
Dostları ilə paylaş: