Java Reference
In-Depth Information
3
Using Classes
and Objects
CHAPTER OBJECTIVES
Discuss the creation of objects and the use of object reference variables.
Explore the services provided by the String class.
Describe how the Java standard class library is organized into packages.
Explore the services provided by the Random and Math classes.
Discuss ways to format output using the NumberFormat and
DecimalFormat classes.
Introduce enumerated types.
Discuss wrapper classes and the concept of autoboxing.
Introduce components and containers used in graphical user interfaces.
Describe a label component and the use of images.
T his chapter further explores the use of predefined classes and
the objects we can create from them. Using classes and objects for
the services they provide is a fundamental part of object-oriented
software and sets the stage for writing classes of our own. In this
chapter, we use classes and objects to manipulate character strings,
produce random numbers, perform complex calculations, and format
output. This chapter also introduces the concept of an enumerated
type, which is a special kind of class in Java, and discusses the con-
cept of a wrapper class. In the Graphics Track of this chapter, we lay
the foundation for developing graphical user interfaces for our pro-
grams and discuss how to display images.
113
 
 
Search WWH ::




Custom Search