Below are few Methods to create and initialize the List

Method 1: Creating a List with one element in one line

If you want a list with only one element, then this is probably best way to create a list. List created by this way is immutable. That means we can not add more elements to this colors list

List<String> colors = Collections.singletonList("Red");

Method 2: Create and initialize a List in one line with multiple elements

List<String> colors = Arrays.asList("Red", "Green", "Blue");

This can create and initialize the List in one line but has got some limitations again. This list colors is immutable. if you will add/delete any additional element to this list, this will throw java.lang.UnsupportedOperationException exception.

Method 3: Create and initialize a mutable List in one line with multiple elements