Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save plateaukao/2597531bb9150e8deff7 to your computer and use it in GitHub Desktop.
Save plateaukao/2597531bb9150e8deff7 to your computer and use it in GitHub Desktop.
public static <T extends Object> List<T> asList(T... args) {
List<T> list = new ArrayList<>();
for (int i = 0; i < args.length; i++) {
list.add(args[i]);
}
return list;
}
@BramYeh
Copy link

BramYeh commented Dec 20, 2015

public static ArrayList asList(T... a) {
ArrayList arrLt = new ArrayList<>();
for(T t : a) {
arrLt.add(t);
}
return arrLt;
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment