|
This chapter covers the following Java Certification Exam objectives:
State the benefits of encapsulation in object-oriented design, and write code
that implements tightly encapsulated classes and the relationships "is
a" and "has a."
State the legal return types for any method given the declarations of all
related methods in this or parent classes.
Write code to invoke overridden or overloaded methods and parental or
overloaded constructors; and describe the effect of invoking these methods.
Declare classes, inner classes, methods, instance variables, static variables,
and automatic (method local) variables, making appropriate use of all permitted
modifiers (such as public, final, static, abstract, and so forth). State the
significance of each of these modifiers both singly and in combination, and
state the effect of package relationships on declared items qualified by these
modifiers.
Write code to construct instances of any concrete class, including normal
top-level classes, inner classes, static inner classes, and anonymous inner
classes.
Identify correctly constructed source files, package declarations, import
statements, class declarations (of all forms, including inner classes),
interface declarations and implementations (for java.lang.Runnable
or other interface described in the test), method declarations (including the
main method that is used to start execution of a class), variable declarations,
and identifiers.
This chapter discusses the object-oriented features of the Java programming
language. Good coding in Java requires a sound understanding of the
object-oriented (OO) paradigm, and this in turn requires a good grasp of the
language features that implement objects and classes. The many benefits of
object orientation have been the subject of considerable public debate, but for
most programmers these benefits have not been realized. In most cases, the
reason the promise has not been fulfilled is simply that programmers have not
been writing objects. Instead, many C++ programmers have been writing a hybrid
form of C with a mixture of procedural and object-oriented code. Unfortunately,
such an approach has given rise, not to some of the benefits of OO, but instead
to all the disadvantages of both styles.
|