---
spec: JVMS
title: "The Java Virtual Machine Specification"
edition: "Java SE 9 Edition"
java_version: 9
chapter: "Chapter 4. The class File Format"
section: "4.2"
heading: "4.2. Names"
parent: "Chapter 4. The class File Format"
source: https://docs.oracle.com/javase/specs/jvms/se9/html/jvms-4.html#jvms-4.2
id: "4.2"
url: https://jvm.obfuscated.software/jvms/se9/4.2.html
raw: https://jvm.obfuscated.software/jvms/se9/4.2.md
---

# 4.2. Names

## 4.2.1. Binary Class and Interface Names

Class and interface names that appear in `class` file structures are always represented in a fully qualified form known as *binary names* (JLS §13.1). Such names are always represented as `CONSTANT_Utf8_info` structures ([§4.4.7](4.4.7.md)) and thus may be drawn, where not further constrained, from the entire Unicode codespace. Class and interface names are referenced from those `CONSTANT_NameAndType_info` structures ([§4.4.6](4.4.6.md)) which have such names as part of their descriptor ([§4.3](4.3.md)), and from all `CONSTANT_Class_info` structures ([§4.4.1](4.4.1.md)).

For historical reasons, the syntax of binary names that appear in `class` file structures differs from the syntax of binary names documented in JLS §13.1. In this internal form, the ASCII periods (`.`) that normally separate the identifiers which make up the binary name are replaced by ASCII forward slashes (`/`). The identifiers themselves must be unqualified names ([§4.2.2](4.2.2.md)).

For example, the normal binary name of class `Thread` is `java.lang.Thread`. In the internal form used in descriptors in the `class` file format, a reference to the name of class `Thread` is implemented using a `CONSTANT_Utf8_info` structure representing the string `java/lang/Thread`.

## 4.2.2. Unqualified Names

Names of methods, fields, local variables, and formal parameters are stored as *unqualified names*. An unqualified name must contain at least one Unicode code point and must not contain any of the ASCII characters `.` `;` `[` `/` (that is, period or semicolon or left square bracket or forward slash).

Method names are further constrained so that, with the exception of the special method names `<init>` and `<clinit>` ([§2.9](2.9.md)), they must not contain the ASCII characters `<` or `>` (that is, left angle bracket or right angle bracket).

Note that a field name or interface method name may be `<init>` or `<clinit>`, but no method invocation instruction may reference `<clinit>` and only the *invokespecial* instruction ([§*invokespecial*](6.5.invokespecial.md)) may reference `<init>`.

## 4.2.3. Module and Package Names

Module names referenced from the `Module` attribute are stored in `CONSTANT_Module_info` structures in the constant pool ([§4.4.11](4.4.11.md)). A `CONSTANT_Module_info` structure wraps a `CONSTANT_Utf8_info` structure that denotes the module name. Module names are not encoded in "internal form" like class and interface names, that is, the ASCII periods (`.`) that separate the identifiers in a module name are not replaced by ASCII forward slashes (`/`).

Module names may be drawn from the entire Unicode codespace, subject to the following constraints:

- A module name must not contain any code point in the range '`\u0000`' to '`\u001F`' inclusive.
- The ASCII backslash (`\`) is reserved for use as an escape character in module names. It must not appear in a module name unless it is followed by an ASCII backslash, an ASCII colon (`:`), or an ASCII at-sign (`@`). The ASCII character sequence `\\` may be used to encode a backslash in a module name.
- The ASCII colon (`:`) and at-sign (`@`) are reserved for future use in module names. They must not appear in module names unless they are escaped. The ASCII character sequences `\:` and `\@` may be used to encode a colon and an at-sign in a module name.

Package names referenced from the `Module` attribute are stored in `CONSTANT_Package_info` structures in the constant pool ([§4.4.12](4.4.12.md)). A `CONSTANT_Package_info` structure wraps a `CONSTANT_Utf8_info` structure that represents a package name encoded in internal form.
