OnJava8-Examples/generics/ListMaker.java

13 lines
342 B
Java
Raw Normal View History

2015-09-07 11:44:36 -06:00
// generics/ListMaker.java
2015-11-14 16:18:05 -08:00
// <20>2016 MindView LLC: see Copyright.txt
2015-06-15 17:47:35 -07:00
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();
}
2015-09-07 11:44:36 -06:00
}
/* Output: (None) */