Answer the question
In order to leave comments, you need to log in
ArrayList throws an error, what should I do?
I study ArrayList, I try to write it down, but here, Eclipse gives an error. He swears at the inscription "ArrayList". Here is the error "The type ArrayList is not generic; it cannot be paramitrazed with arguments" as I understand it, it says here that it does not work in Integer, however, on the site where I study Java it says that it does not work with "Int", and with "Integer" just works. What is the point then? The code itself:
package ffd;
public class ArrayList {
public static void main(String[] args) {
// TODO Auto-generated method stub
ArrayList<Integer> list = new ArrayList<>();
list.add(22);
list.add(54);
list.add(69);
}
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question