0

Generic object of type array?

Can the generic parameter be an array? Like: Sample<String[]> s = new Sample<String[]>();

15th Sep 2019, 2:16 PM
Jamie Charles
1 Respuesta
0
Yes. You can test it with an ArrayList: ArrayList<int[]> myArrays = new ArrayList<>(); Now you can add integer arrays in this list. ArrayList<String[]>() for String arrays and so on.
15th Sep 2019, 8:02 PM
Denise Roßberg
Denise Roßberg - avatar