Reputation: 54133
In C# I can do this:
public class QuadTree<T> where T : IHasRect
Is there a way to do something similar in Java?
Upvotes: 0
Views: 212
Reputation: 691903
If where T : IHasRect
means that T
is a type that must implement the IHasRect
interface, the Java equivalent is
public class QuadTree<T extends HasRect>
Read the generics tutorial for more information.
Upvotes: 11