at the moment i am trying to build a Java class which is able to creat a random Object. I tryed it with Factory Pattern and the abstract Product Interface is like :
public interface ObjectFactory<T>
{
T createObject();
}
but when i am trying to implement a concret generic Product it dosn't work. Here is the Code of my concrete Product:
public class GenericFactory implements ObjectFactory<T> {
@Override
public T createObject()
{
return new T();
}
}
IntelliJ says: "Cannot resolve symbol T"