public static void main(String[] args){ List<List<Object>> list = new ArrayList<List<Object>>();
list.add(new ArrayList<Object>());
list.get(0).add("String things");

System.out.println(list.get(0).get(0));
}
这是我写的,没有报错
使用前要注意初始化里层的List,你是不是没new就使用了

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-05-29
  • 2021-05-20
  • 2022-12-23
  • 2022-12-23
  • 2021-12-29
  • 2021-07-15
猜你喜欢
  • 2022-12-23
  • 2021-08-10
  • 2022-12-23
  • 2021-10-24
  • 2022-12-23
  • 2022-12-23
  • 2021-10-06
相关资源
相似解决方案