Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我希望构建类型的空列表List<String>。我能想出的满足类型检查器的最好的方法是:
List<String>
(List<String>) (Object) List.nil()
这是非常丑陋的。有更好的吗?
这是另一种选择:
List<String> l = List.<String>nil();
这应该这样做:
List<String> myList = list();