ArrayList is not shared; cannot be parameterized

So, I'm trying to create an ArrayList of type Item, which is an object of the Item class, which I defined in a separate file. This is the code that is related to the problem:

import java.util.ArrayList; 
private ArrayList<Item> items = new ArrayList<Item>(); 

The error I am getting is this:

The type ArrayList is not generic; it cannot be paramaterized with arguments <Item>

I have another file for another program in which I declared and used ArrayList and Object, and it worked fine.

I am new to Java, so if this is a newbie mistake, I'm sorry. What can I do to fix this problem?

+4
source share
2 answers

, java- Eclipse. , / : " ArrayList ? ?

: 1. Properties, Java Compiler 2. , 1,5, .

+5

, , , , . , , .

, . , eclipse JRE .

0

All Articles