Suppose I\'m trying to write a function to return an instance of the current type. Is there a way to make T refer to the exact subtype (so T should
T
Just write:
class A { A foo() { ... } } class B extends A { @Override B foo() { ... } }
assuming you're using Java 1.5+ (covariant return types).