gpt4 book ai didi

java - 无法实例化 itextpdf 的类型列表

转载 作者:行者123 更新时间:2023-12-01 13:15:55 25 4
gpt4 key购买 nike

我想以 pdf 格式显示客户列表。我使用这个属性:

 List<Client> client;

这是一种创建要在 PDF 上显示的特殊列表的方法:

private static void createList(Section subCatPart){

List list = new List(true, false, 10);

List.add(new ListItem("First point");
List.add(new ListItem("Second point");

SubCatPart.add(list);}

但它说“List 无法实例化类型 List”(在 createList 方法中)。

最佳答案

List是一个接口(interface)。你无法实例化它。使用任何子类,如 ArrayList像下面这样

List<Client> clientList = new ArrayList<Client>();

关于java - 无法实例化 itextpdf 的类型列表,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22474410/

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