如果我们有以下变量声明:
List<int> list = new List(5);
Run Code Online (Sandbox Code Playgroud)
为什么这样:
list.insert(2, 3);
Run Code Online (Sandbox Code Playgroud)
失败,出现以下错误:
Index must be within the bounds of the List.
Run Code Online (Sandbox Code Playgroud)
提供初始尺寸有什么意义?