OnJava8-Examples/generics/BasicHolder.java
2015-11-03 12:00:44 -08:00

11 lines
219 B
Java

// generics/BasicHolder.java
public class BasicHolder<T> {
T element;
void set(T arg) { element = arg; }
T get() { return element; }
void f() {
System.out.println(element.getClass().getSimpleName());
}
}