What does a tilde in angle brackets mean when creating a Java generic class?

It is just a shorthand for “same as in declaration”.

Some IDEs, e.g. IntelliJ use this too.

The files on disk do not have this notation, which is only a compaction in the IDE GUI.

Leave a Comment