gpt4 book ai didi

java - 从列表中获取数据

转载 作者:行者123 更新时间:2023-11-29 03:27:50 25 4
gpt4 key购买 nike

我需要从字符串列表中取出前 200 个字符串,我正在使用一个带有标志的 for 循环( child 的东西)。有没有更好的方法?

最佳答案

这样做:

   List sublist = list.subList(0, 200);

如果你使用过泛型,那么记得将它们包含在子列表中:

  List<String> sublist = list.subList(0, 200);

关于java - 从列表中获取数据,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20067741/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com