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

# 4.6. Type Erasure

Type erasure is a mapping from types (possibly including parameterized types and type variables) to types (that are never parameterized types or type variables). We write |T| for the erasure of type T. The erasure mapping is defined as follows:

- The erasure of a parameterized type ([§4.5](4.5.md)) G`<`T_1,...,T_n`>` is |G|.
- The erasure of a nested type T`.`C is |T|.C.
- The erasure of an array type T`[]` is |T|`[]`.
- The erasure of a type variable ([§4.4](4.4.md)) is the erasure of its leftmost bound.
- The erasure of every other type is the type itself.

Type erasure also maps the signature ([§8.4.2](8.4.2.md)) of a constructor or method to a signature that has no parameterized types or type variables. The erasure of a constructor or method signature s is a signature consisting of the same name as s and the erasures of all the formal parameter types given in s.

The return type of a method ([§8.4.5](8.4.5.md)) and the type parameters of a generic method or constructor ([§8.4.4](8.4.4.md), [§8.8.4](8.8.4.md)) also undergo erasure if the method or constructor's signature is erased.

The erasure of the signature of a generic method has no type parameters.
