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.
在早期版本的 Scala 中,您可以使用 List.make(100, 1),但现在已弃用。什么是新的正确方法?
如已弃用的注释中所述:
@deprecated("use `fill' instead", "2.8.0")
试试这个:
List.fill(100)(1)
正如文档所说: