Communities for your favorite technologies. Explore all Collectives
Ask questions, find answers and collaborate at work with Stack Overflow for Teams.
Ask questions, find answers and collaborate at work with Stack Overflow for Teams. Explore Teams
Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Since Java 8 there is an easier way to transform:
import java.util.List; import static java.util.stream.Collectors.toList; public static <T> List<T> fromArray(T[] array) { return Arrays.stream(array).collect(toList()); }
public static <T> List<T> fromArray(T[] array) { return Arrays.stream(array).collect(toList()); }
Since Java 8 there is easier way to transform:
public static <T> List<T> getfromArray(T[] array) { return Arrays.stream(array).collect(toList()); }
public static <T> List<T> get(T[] array) { return Arrays.stream(array).collect(toList()); }