Type Aliases
When a type name is very long or not intuitive in certain contexts, you can use the type keyword to define an alias for it. type NameList = ArrayList<String> creates a short and meaningful name.
Type aliases do not create new types; they are just another name for the original type. Aliases and original types can be used interchangeably, and the compiler will completely replace aliases with the original types. When a particular generic instantiation appears repeatedly in code, aliases can significantly improve readability.
The code on the right defines two type aliases: NameList represents a string list, and ScoreMap represents a mapping from strings to scores. Using these aliases makes the code's intent clearer while reducing repetitive generic parameters.