Chapter 3

Working with Numbers and Expressions

In This Chapter

arrow Dealing with operators, such as +, -, *, and /

arrow Creating finely crafted expressions

arrow Incrementing and decrementing

arrow Accepting an assignment

arrow Using the Math class

arrow Formatting your numbers

arrow 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 ...

Get Java All-in-One For Dummies, 4th Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.