3

In which situations would we use the following technique?

class A<T>
class B extends A<B> // the B appears twice

What are the benefits of such an approach?

For example, I have seen such a definition:

class HttpBase<T>

Then

class HttpRequest extends HttpBase<HttpRequest>

Also

class HttpResponse extends HttpBase<HttpResponse>
Duncan Jones
  • 67,400
  • 29
  • 193
  • 254
liango
  • 786
  • 7
  • 18

0 Answers0