java arraylist one line initialization code example Example: java instantiate collection with values List<Integer> integerArray = Arrays.asList(2, 41, 42, 48);