java Programming Glossary: lol.add
Multiple wildcards on a generic methods makes Java compiler (and me!) very confused http://stackoverflow.com/questions/3546745/multiple-wildcards-on-a-generic-methods-makes-java-compiler-and-me-very-confu static void probablyIllegal List List lol List list lol.add list this compiles how come The above code compiles for me.. rightfullyIllegal List List extends Number lol List list lol.add list DOES NOT COMPILE As expected The method add List extends.. List List extends Number lol List extends Number list lol.add list compiles fine how come Again we may have e.g. a List List..
|