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

10 lines
283 B
Java

//: generics/ListOfGenerics.java
// ©2015 MindView LLC: see Copyright.txt
import java.util.*;
public class ListOfGenerics<T> {
private List<T> array = new ArrayList<>();
public void add(T item) { array.add(item); }
public T get(int index) { return array.get(index); }
} ///:~