aboutsummaryrefslogtreecommitdiffstats
path: root/src/test/test3/Erasure.java
blob: 7514981ab7466c83269a47f384f7f5b89ee88181 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
package test3;

interface ErasureGet<T> {
    T get();
}

public class Erasure<T> {
    T value;
    public Erasure(T t) { value = t; }
    public Erasure() { value = null; }
    public int run() {
        @SuppressWarnings("unchecked")
        ErasureGet<String> obj = (ErasureGet<String>)new Erasure<String>("1234");
        return obj.get().length();
    }
}