Ethan Ferguson
Ethan Ferguson

Reputation: 69

Array list integer not working

i am trying to make an ArrayList of type integer, but it gives me this error(I am using this compiler called jikes) Code:

   ArrayList<Integer> = new ArrayList<Integer>();

Error:

***Semantic error: using type arguments to access generic types requires the use of "-source 1.5"'or greater. Compilation will continue to use the raw type "Java.util.arraylist", but no class file will be emitted.

Upvotes: 0

Views: 688

Answers (3)

segaurav
segaurav

Reputation: 217

try following:

List<Integer> list = new ArrayList<Integer>();

Upvotes: 1

Galunid
Galunid

Reputation: 578

Your arraylist has no name:

ArrayList<Integer> name = new ArrayList<>();

Upvotes: 2

badal16
badal16

Reputation: 509

Correct initialization should be

ArrayList<Integer> X = new ArrayList<Integer>();

you need to assign variable

Upvotes: 0

Related Questions