I wrote a simple class that parametrizes an object inside it
public class FooToReturn<T extends Foo>{
T object;
public T getObject(){
return object;
}
}
and some function in another class needs to return a parametrized instance of it, like
public FooToReturn doSomething(){
....
return new FooToReturn<ChildFoo>();
}
Is it possible to just keep the return FooToReturn
in the declaration or will it give me error at runtime? Eclipse already gives me this warning at the function declaration.
References to generic type FooToReturn<T> should be parameterized