O'Reilly logo

Java All-in-One For Dummies, 5th Edition by Doug Lowe

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 3

Working with Numbers and Expressions

IN THIS CHAPTER

check Dealing with operators, such as +, –, *, and /

check Creating finely crafted expressions

check Incrementing and decrementing

check Accepting an assignment

check Using the Math class

check Formatting your numbers

check Seeing strange things that can happen with numbers

In Book 2, 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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required