What Are Bits and Bytes

This section describes bits and bytes as data storage units and as data types.

Bit - The smallest storage unit in the computer world. It can only hold two possible values: 0 and 1.

Bit - The smallest unit of measure of digital information size.

Bit - A single digit of a binary number. It can only have two possible values: 0 and 1.

Byte - A storage unit with 8 bits. A byte can hold 256 possible values.

Byte - A unit of measure of digital information size. 1 byte = 8 bits. For example, a Java source code file, Hello.java, has a size of 109 bytes.

Byte - A data type in many programming language. It can be used to store 256 possible integer values. In Java, 'byte' is a primitive data type that can store an integer value in the range of -128 and 127.

Last update: 2014.

Table of Contents

 About This Book

 Installing JDK 1.8 on Windows

 Execution Process, Entry Point, Input and Output

 Primitive Data Types and Literals

Bits, Bytes, Bitwise and Shift Operations

What Are Bits and Bytes

 "byte" Data Type and Implicit Casting

 Operations on "byte" Data Type Values

 Bitwise Operations on "byte" Values

 Bitwise Operations on "byte" Values - Example Program

 Shift Operations - Left, Right or Unsigned Right Shift

 Managing Bit Strings in Byte Arrays

 Reference Data Types and Variables

 StringBuffer - The String Buffer Class

 System Properties and Runtime Object Methods

 Generic Classes and Parameterized Types

 Generic Methods and Type Inference

 Lambda Expressions and Method References

 Execution Threads and Multi-Threading Java Programs

 ThreadGroup Class and "system" ThreadGroup Tree

 Synchronization Technique and Synchronized Code Blocks

 Deadlock Condition Example Programs

 Garbage Collection and the gc() Method

 Outdated Tutorials

 References

 PDF Printing Version