资源描述:
《[Java泛型和集合].(Java.Generics.and.Collections).Maurice.Naftalin&Philip.Wadler.文字版》由会员上传分享,免费在线阅读,更多相关内容在学术论文-天天文库。
1、JavaGenericsandCollectionsMauriceNaftalinandPhilipWadlerBeijing•Cambridge•Farnham•Köln•Sebastopol•Taipei•TokyoJavaGenericsandCollectionsbyMauriceNaftalinandPhilipWadlerCopyright©2007O’ReillyMedia.Allrightsreserved.PrintedintheUnitedStatesofAmerica.PublishedbyO’ReillyMedia,Inc.,1005Grave
2、nsteinHighwayNorth,Sebastopol,CA95472.O’Reillybooksmaybepurchasedforeducational,business,orsalespromotionaluse.Onlineeditionsarealsoavailableformosttitles(http://safari.oreilly.com).Formoreinformation,contactourcorporate/institutionalsalesdepartment:(800)998-9938orcorporate@oreilly.com.
3、Editor:MikeLoukidesIndexers:MauriceNaftalinandPhilipWadlerProductionServices:WindfallSoftwareCoverDesigner:KarenMontgomeryPrintingHistory:October2006:FirstEdition.NutshellHandbook,theNutshellHandbooklogo,andtheO’ReillylogoareregisteredtrademarksofO’ReillyMedia,Inc.JavaGenericsandCollect
4、ions,theimageofanalligator,andrelatedtradedressaretrademarksofO’ReillyMedia,Inc.Manyofthedesignationsusedbymanufacturersandsellerstodistinguishtheirproductsareclaimedastrademarks.Wherethosedesignationsappearinthisbook,andO’ReillyMedia,Inc.wasawareofatrademarkclaim,thedesignationshavebee
5、nprintedincapsorinitialcaps.Whileeveryprecautionhasbeentakeninthepreparationofthisbook,thepublisherandauthorsassumenoresponsibilityforerrorsoromissions,orfordamagesresultingfromtheuseoftheinformationcon-tainedherein.TMThisbookusesRepKover™,adurableandflexiblelay-flatbinding.ISBN:978-0-5
6、96-52775-4[M][2/09]1233352047WededicatethisbooktoJoyceNaftalin,LionelNaftalin,AdamWadler,andLeoraWadler—MauriceNaftalinandPhilipWadlerTableofContentsPreface.....................................................................xiPartI.Generics1.Introduction................................
7、...........................31.1Generics41.2BoxingandUnboxing61.3Foreach91.4GenericMethodsandVarargs101.5Assertions122.SubtypingandWildcards................................................152.1SubtypingandtheSubstitutionPrinciple152.2Wildcardswithextends172.3Wildcardswithsuper18