OnJava8-Examples/generics/ListMaker.java
Bruce Eckel 49edcc8b17 reorg
2015-06-15 17:47:35 -07:00

12 lines
347 B
Java

//: generics/ListMaker.java
// ©2015 MindView LLC: see Copyright.txt
import java.util.*;
public class ListMaker<T> {
List<T> create() { return new ArrayList<>(); }
public static void main(String[] args) {
ListMaker<String> stringMaker= new ListMaker<>();
List<String> stringList = stringMaker.create();
}
} /* Output: (None) *///:~