Created
December 20, 2015 12:21
-
-
Save plateaukao/2597531bb9150e8deff7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
public static ArrayList asList(T... a) {
ArrayList arrLt = new ArrayList<>();
for(T t : a) {
arrLt.add(t);
}
return arrLt;
}