public interface Cache<T>{
public void put(String key,T value);
public Object get(Object key);
}
public class CacheImpl<T> implements Cache {
private static Object monitor = new Object();
private static CacheImpl instance;
private Map<String, T> cache = Collections.synchronizedMap(new HashMap<String, T>());
}
In the above code I have to use generics for Type Safety Check, but getting error in implemented class.