Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Why do instantiations of generic types share the same runtime type? #10

Open
@ThomsonTang

Description

Because of type erasure.

the compiler translates the generic and parameterized types by a technique called type erasure. Basically, the compiler elides all information related to type parameters and type arguments.

For instance, ArrayList<String> and ArrayList<Long> have the same raw type ArrayList after the type erasure.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

        AltStyle によって変換されたページ (->オリジナル) /