---
spec: JLS
title: "The Java Language Specification"
edition: "Java SE 12 Edition"
java_version: 12
chapter: "Chapter 4. Types, Values, and Variables"
section: "4.2"
heading: "4.2. Primitive Types and Values"
parent: "Chapter 4. Types, Values, and Variables"
source: https://docs.oracle.com/javase/specs/jls/se12/html/jls-4.html#jls-4.2
id: "4.2"
url: https://jvm.obfuscated.software/jls/se12/4.2.html
raw: https://jvm.obfuscated.software/jls/se12/4.2.md
---

# 4.2. Primitive Types and Values

A primitive type is predefined by the Java programming language and named by its reserved keyword ([§3.9](3.9.md)):

```
PrimitiveType:
  {Annotation} NumericType
  {Annotation} boolean

NumericType:
  IntegralType
  FloatingPointType

IntegralType:
  (one of)
  byte short int long char

FloatingPointType:
  (one of)
  float double
```

Primitive values do not share state with other primitive values.

The *numeric types* are the integral types and the floating-point types.

The *integral types* are `byte`, `short`, `int`, and `long`, whose values are 8-bit, 16-bit, 32-bit and 64-bit signed two's-complement integers, respectively, and `char`, whose values are 16-bit unsigned integers representing UTF-16 code units ([§3.1](3.1.md)).

The *floating-point types* are `float`, whose values include the 32-bit IEEE 754 floating-point numbers, and `double`, whose values include the 64-bit IEEE 754 floating-point numbers.

The `boolean` type has exactly two values: `true` and `false`.

**Sections:**

- [4.2.1. Integral Types and Values](4.2.1.md)
- [4.2.2. Integer Operations](4.2.2.md)
- [4.2.3. Floating-Point Types, Formats, and Values](4.2.3.md)
- [4.2.4. Floating-Point Operations](4.2.4.md)
- [4.2.5. The boolean Type and boolean Values](4.2.5.md)
