0

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.

Javier
  • 12,100
  • 5
  • 46
  • 57

3 Answers3

2

Your arraylist has no name:

ArrayList<Integer> name = new ArrayList<>();
Tom
  • 16,842
  • 17
  • 45
  • 54
Galunid
  • 578
  • 6
  • 14
1

try following:

List<Integer> list = new ArrayList<Integer>();
segaurav
  • 217
  • 2
  • 5
0

Correct initialization should be

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

you need to assign variable

badal16
  • 499
  • 1
  • 5
  • 18