Java Generics Puzzler, extending a class and using wildcards

前端 未结 6 1798
不知归路
不知归路 2021-01-31 02:02

I\'ve been beating my head against this one for awhile and thought that maybe some fresh eyes will see the issue; thanks for your time.

import java.util.*;

clas         


        
6条回答
  •  -上瘾入骨i
    2021-01-31 02:28

    You're using a bounded wildcard (TbinList> ...). This wildcard will prevent you from adding any elements to the list. If you want more info, heres the section about Wildcards in the docs.

提交回复
热议问题