package generics; public class TestGenerics { T ob; TestGenerics(T ob){ this.ob = ob; } public T getValue(){ return ob; } public void getType(){ System.out.println(ob.getClass().getName()); } public static void main(String[] args) { TestGenerics testInteger = new TestGenerics<>(10); testInteger.getType(); TestGenerics testString = new TestGenerics<>("This is a test String.."); testString.getType(); } }