© Doug Winnie 2021
D. WinnieEssential Java for AP CompScihttps://doi.org/10.1007/978-1-4842-6183-5_15

15. Binary

Doug Winnie1  
(1)
Mission Hills, KS, USA
 

We can represent the binary states of “on” and “off” as numbers. The binary number system is based on only two digits: one and zero. For a binary state of on, that’s represented by a one. For a binary state of off, that’s represented by a zero.

But storing a single value doesn’t make much sense on its own. You would want to store multiple values in a row. To do that, you would create a string of them, and since they are all numbers, you are just creating a larger number with multiple digits or bits.

A grouping of eight binary digits is called a byte, spelled with a y. A byte is a common measure of ...

Get Essential Java for AP CompSci: From Programming to Computer Science 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.