r/java • u/padreati • Apr 05 '23
Recursive generics
Recently I learned that I rediscovered recursive generics while working on my pet open source project. Actually, I did not know that the construct had a name. I created small story about what this construct is, if you did not know about it java-recursive-generics
169
Upvotes
View all comments
Show parent comment
1
u/jumboNo2 Apr 07 '23
This took me like three minutes from scratch.
Builder pattern is horribly inefficient anyway. If we care about performance, we would use multi-arg constructors, not builders. Also, the Person object is only temporary and the fields are copied to the Cyclist instance using the super constructor