Chapter 8

Numbers? Who Needs Numbers?

IN THIS CHAPTER

check Working with characters

check Dealing with “true” or “false” values

check Rounding out your knowledge of Java’s primitive types

I don’t particularly like fax machines. They’re so inefficient. Send a short fax, and what do you have? You have two slices of a tree — one at the sending end and another at the receiving end. You also have millions of dots — dots that scan tiny little lines across the printed page. The dots distinguish patches of light from patches of darkness. What a waste!

Compare a fax with an email message. Using email, I can send a 25-word contest entry with just 2,500 zeros and ones, and I don’t waste any paper. Best of all, an email message doesn’t describe light dots and dark dots. An email message contains codes for each of the letters — a short sequence of zeros and ones for the letter A, a different sequence of zeros and ones for the letter B, and so on. What could be simpler?

Now imagine sending a one-word fax. The word is true, which is understood to mean, “True, I accept your offer to write Beginning Programming with Java For Dummies, 5th Edition.” A fax with this message sends a picture of the four letters t-r-u-e, ...

Get Beginning Programming with Java For Dummies, 5th 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.