Chapter 3
Working with Numbers and Expressions
In This Chapter
Dealing with operators, such as +, -, *, and /
Creating finely crafted expressions
Incrementing and decrementing
Accepting an assignment
Using the Math class
Formatting your numbers
Seeing strange things that can happen with numbers
In Book II, Chapter 2, you discover the various primitive numeric types that are supported by Java. In this chapter, you build on that knowledge by doing basic operations with numbers. Much of this chapter focuses on the complex topic of expressions, which combine numbers with operators to perform calculations. This chapter also covers performing advanced calculations using the Math class and techniques for formatting numbers when you display them. In addition, you find out why Java's math operations ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access