문제

I want to display in a pdf a list of clients. I use this attribute :

 List<Client> client;

This is a method wihch creates a special list to be displayed on the 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);}

But it says that "List cannot instantiate the type List"( in the method createList).

도움이 되었습니까?

해결책

List is an interface. You can't instantiate it. Use any subclass like ArrayList like below

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

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top