Neither is correct.
It is correct to declare such a reference by its interface, so that gives you
You will have problems accessing these two methods:
1 2, because it will need a cast.
Have a look at the
Java™ Tutorials. You need to use an actual type parameter
<String> to ensure that all its elements are the same type and to obviate any casting whenever you
get(...) any elements. If you find an old (Java5/6/7) edition of the Java™ Tutorials, you can find a different description of generics. It is usually possible to miss out the second actual type parameter because the compiler can infer it 99% of the time.
The correct way to declare and initialise your List is
You may use a different
constructor.
Moving you to a more appropriate forum.