Java, Java, Java
8. Java Data and Operators
OBJECTIVES
After studying this chapter, you will
Understand the role that data play in effective program design.
Be able to use all of Java’s primitive types and their operators.
Appreciate the importance of information hiding.
Be able to use class constants and class methods.
Know how to use Java’s Math and NumberFormat classes.
Be able to perform various kinds of data conversions.
OUTLINE
Introduction
Boolean Data and Operators Special Topic: Are We Computers?
Numeric Data and Operators
From the Java Library: java.lang.Math
Numeric Processing Examples
From the Java Library: java.text.NumberFormat
Character Data and Operators
Example: Character Conversions
Problem Solving = Representation + Action
Chapter Summary
Solutions to Self-Study Exercises Exercises
197
Figure 5.1: Can the chess board be tiled with dominoes?