I have an array that is initialized like:
Element[] array = {new Element(1), new Element(2), new Element(3)};
I would like to convert this
In Java 9 you can use:
Java 9
List list = List.of("Hello", "World", "from", "Java"); List list = List.of(1, 2, 3, 4, 5);