---
spec: JLS
title: "The Java Language Specification"
edition: "Java SE 9 Edition"
java_version: 9
chapter: "Chapter 3. Lexical Structure"
section: "3"
heading: "Chapter 3. Lexical Structure"
source: https://docs.oracle.com/javase/specs/jls/se9/html/jls-3.html
id: "3"
url: https://jvm.obfuscated.software/jls/se9/3.html
raw: https://jvm.obfuscated.software/jls/se9/3.md
---

# Chapter 3. Lexical Structure

This chapter specifies the lexical structure of the Java programming language.

Programs are written in Unicode ([§3.1](3.1.md)), but lexical translations are provided ([§3.2](3.2.md)) so that Unicode escapes ([§3.3](3.3.md)) can be used to include any Unicode character using only ASCII characters. Line terminators are defined ([§3.4](3.4.md)) to support the different conventions of existing host systems while maintaining consistent line numbers.

The Unicode characters resulting from the lexical translations are reduced to a sequence of input elements ([§3.5](3.5.md)), which are white space ([§3.6](3.6.md)), comments ([§3.7](3.7.md)), and tokens. The tokens are the identifiers ([§3.8](3.8.md)), keywords ([§3.9](3.9.md)), literals ([§3.10](3.10.md)), separators ([§3.11](3.11.md)), and operators ([§3.12](3.12.md)) of the syntactic grammar.

**Sections:**

- [3.1. Unicode](3.1.md)
- [3.2. Lexical Translations](3.2.md)
- [3.3. Unicode Escapes](3.3.md)
- [3.4. Line Terminators](3.4.md)
- [3.5. Input Elements and Tokens](3.5.md)
- [3.6. White Space](3.6.md)
- [3.7. Comments](3.7.md)
- [3.8. Identifiers](3.8.md)
- [3.9. Keywords](3.9.md)
- [3.10. Literals](3.10.md)
- [3.11. Separators](3.11.md)
- [3.12. Operators](3.12.md)
