O'Reilly logo

Beginning Programming with Java For Dummies, 5th Edition by Barry A. Burd

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 7

Numbers and Types

IN THIS CHAPTER

check Processing whole numbers

check Making new values from old values

check Understanding Java’s more exotic types

Not so long ago, people thought computers did nothing but big, number-crunching calculations. Computers solved arithmetic problems, and that was the end of the story.

In the 1980s, with the widespread use of word processing programs, the myth of the big metal math brain went by the wayside. But even then, computers made great calculators. After all, computers are very fast and very accurate. Computers never need to count on their fingers. Best of all, computers don’t feel burdened when they do arithmetic. I hate ending a meal in a good restaurant by worrying about the tax and tip, but computers don’t mind that stuff at all. (Even so, computers seldom go out to eat.)

Using Whole Numbers

Let me tell you, it’s no fun being an adult. Right now I have four little kids in my living room. They’re all staring at me because I have a bag full of gumballs in my hand. With 30 gumballs in the bag, the kids are all thinking, “Who’s the best? Who gets more gumballs than the others? And who’s going to be treated unfairly?” They insist on a complete, official ...

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