---
spec: JLS
title: "The Java Language Specification"
edition: "Java SE 8 Edition"
java_version: 8
chapter: "Chapter 6. Names"
section: "6.5.5"
heading: "6.5.5. Meaning of Type Names"
parent: "6.5. Determining the Meaning of a Name"
source: https://docs.oracle.com/javase/specs/jls/se8/html/jls-6.html#jls-6.5.5
id: "6.5.5"
url: https://jvm.obfuscated.software/jls/se8/6.5.5.html
raw: https://jvm.obfuscated.software/jls/se8/6.5.5.md
---

# 6.5.5. Meaning of Type Names

The meaning of a name classified as a *TypeName* is determined as follows.

## 6.5.5.1. Simple Type Names

If a type name consists of a single *Identifier*, then the identifier must occur in the scope of exactly one visible declaration of a type with this name, or a compile-time error occurs. The meaning of the type name is that type.

## 6.5.5.2. Qualified Type Names

If a type name is of the form `Q.Id`, then `Q` must be either a type name or a package name.

If `Id` names exactly one accessible type ([§6.6](6.6.md)) that is a member of the type or package denoted by `Q`, then the qualified type name denotes that type.

If `Id` does not name a member type within `Q` ([§8.5](8.5.md), [§9.5](9.5.md)), or the member type named `Id` within `Q` is not accessible ([§6.6](6.6.md)), or `Id` names more than one member type within `Q`, then a compile-time error occurs.

**Example 6.5.5.2-1. Qualified Type Names**

```
class Test {
    public static void main(String[] args) {
        java.util.Date date =
            new java.util.Date(System.currentTimeMillis());
        System.out.println(date.toLocaleString());
    }
}
```

This program produced the following output the first time it was run:

```
Sun Jan 21 22:56:29 1996
```

In this example, the name `java.util.Date` must denote a type, so we first use the procedure recursively to determine if `java.util` is an accessible type or a package, which it is, and then look to see if the type `Date` is accessible in this package.
