Skip to content
Advertisement

How do I set an empty list of a certain type

We have Collections.EMPTY_LIST but it is not typed, which shows an eclipse warning. How do I set an empty list of a certain type.

Advertisement

Answer

Try this

JavaScript

See this also Type-safe, generic, empty Collections with static generics

Advertisement