What are the use of interfaces with type parameters? what are they really used for? is my understanding correct.
Let’s say I have this interface
public interface Moveable <Person>{
void move(double x, double z);
}
Does this mean that only objects that are Type Person can use /implement this?
That’s not the typical pattern and in your case the type parameter isn’t doing anything. Here’s a better example.
Now your code will return the type that the implementer specifies instead of you just saying move always returns object or some other more generic class.
Edit:
You can’t really restrict implementers of your interface to be certain types. You can restrict it by package if you want. Maybe an abstract class would work better for you.