OnJava8-Examples/generics/ListMaker.java

12 lines
328 B
Java
Raw Normal View History

2015-04-20 15:36:01 -07:00
//: generics/ListMaker.java
2015-05-29 14:18:51 -07:00
// <20>2015 MindView LLC: see Copyright.txt
2015-04-20 15:36:01 -07:00
import java.util.*;
public class ListMaker<T> {
2015-05-05 11:20:13 -07:00
List<T> create() { return new ArrayList<>(); }
2015-04-20 15:36:01 -07:00
public static void main(String[] args) {
2015-05-05 11:20:13 -07:00
ListMaker<String> stringMaker= new ListMaker<>();
2015-04-20 15:36:01 -07:00
List<String> stringList = stringMaker.create();
}
} ///:~