资源描述:
《[Java泛型和集合]》由会员上传分享,免费在线阅读,更多相关内容在学术论文-天天文库。
1、JavaGenericsandCollectionsMauriceNaftalinandPhilipWadlerBeijing•Cambridge•Farnham•Köln•Sebastopol•Taipei•TokyoJavaGenericsandCollectionsbyMauriceNaftalinandPhilipWadlerCopyright©2007O‘ReillyMedia.Allrightsreserved.PrintedintheUnitedStatesofAmerica.PublishedbyO‘ReillyMedia,Inc.,1005GravensteinH
2、ighwayNorth,Sebastopol,CA95472.O‘Reillybooksmaybepurchasedforeducational,business,orsalespromotionaluse.Onlineeditionsarealsoavailableformosttitles(http://safari.oreilly.com).Formoreinformation,contactourcorporate/institutionalsalesdepartment:(800)998-9938orcorporate@oreilly.com.Editor:MikeLou
3、kidesIndexers:MauriceNaftalinandPhilipWadlerProductionServices:WindfallSoftwareCoverDesigner:KarenMontgomeryPrintingHistory:October2006:FirstEdition.NutshellHandbook,theNutshellHandbooklogo,andtheO‘ReillylogoareregisteredtrademarksofO‘ReillyMedia,Inc.JavaGenericsandCollections,theimageofanalli
4、gator,andrelatedtradedressaretrademarksofO‘ReillyMedia,Inc.Manyofthedesignationsusedbymanufacturersandsellerstodistinguishtheirproductsareclaimedastrademarks.Wherethosedesignationsappearinthisbook,andO‘ReillyMedia,Inc.wasawareofatrademarkclaim,thedesignationshavebeenprintedincapsorinitialcaps.
5、Whileeveryprecautionhasbeentakeninthepreparationofthisbook,thepublisherandauthorsassumenoresponsibilityforerrorsoromissions,orfordamagesresultingfromtheuseoftheinformationcon-tainedherein.TMThisbookusesRepKover™,adurableandflexiblelay-flatbinding.ISBN:978-0-596-52775-4[M][2/09]1233352047Wededi
6、catethisbooktoJoyceNaftalin,LionelNaftalin,AdamWadler,andLeoraWadler—MauriceNaftalinandPhilipWadlerTableofContentsPreface........................................................................................xiPartI.Generics1.Introduction.......................................................
7、.....................31.1Generics41.2BoxingandUnboxing61.3Foreach91.4GenericMethodsandVarargs101.5Assertions122.SubtypingandWildcards...........................................................152.1SubtypingandtheSubstitutionPrinciple152