【发布时间】:2020-01-27 15:43:57
【问题描述】:
我有一些 Map 0f Map 0f List
我为它创建了这样的界面
public interface ShortName extends Map<String, Map<String, List<String>>>
但是当我尝试实例化真实对象时,它给了我ClassCastExcpetion
ShortName testObj = (ShortName) new HashMap<String, Map<String, List<String>>>();
有没有办法为 Map 制作短类型
【问题讨论】:
-
没有。 Java 中没有类型别名。
标签: java