Answer the question
In order to leave comments, you need to log in
What is the practical use of self-restriction in Java?
What is the meaning of this snippet? A class can only take an instance of itself as a type parameter, but what's the use of that?
public class MyGeneric<T extends MyGeneric<T>> {
T element;
public MyGeneric(T element) {
this.element = element;
}
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question