java - Generic Lower bounded Method -


Assume that I have the following classes animals , fish And catfish .

Catfish extended fish and fish extension animals .

MyPets is a general category called , in which there is a type parameter (normal) called T , and with paragraphs Will be done. Objects.

My question is, how do I create a lower bound method in D which is the catfish class.

.

TL; DR:

Type parameters can have several bounds, such as a class box {...}. But there can be no lower bound in a type parameter, that is, a composition such as the class box {...} is not allowed. why not? The answer is: It is useless because it does not buy you anything, it is allowed.

Comments

Popular posts from this blog

excel vba - How to delete Solver(SOLVER.XLAM) code -

github - Teamcity & Git - PR merge builds - anyway to get HEAD commit hash? -

ios - Replace text in UITextView run slowly -