OnJava8-Examples/generics/ListOfGenerics.java

9 lines
243 B
Java
Raw Normal View History

2015-04-20 15:36:01 -07:00
//: generics/ListOfGenerics.java
import java.util.*;
public class ListOfGenerics<T> {
private List<T> array = new ArrayList<T>();
public void add(T item) { array.add(item); }
public T get(int index) { return array.get(index); }
} ///:~