




已阅读5页,还剩8页未读, 继续免费阅读
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
0外文资料ThinkinginJava,2ndeditionPrefaceIsuggestedtomybrotherTodd,whoismakingtheleapfromhardwareintoprogramming,thatthenextbigrevolutionwillbeingeneticengineering.Wellhavemicrobesdesignedtomakefood,fuel,andplastic;theyllcleanuppollutionandingeneralallowustomasterthemanipulationofthephysicalworldforafractionofwhatitcostsnow.Iclaimedthatitwouldmakethecomputerrevolutionlooksmallincomparison.ThenIrealizedIwasmakingamistakecommontosciencefictionwriters:gettinglostinthetechnology(whichisofcourseeasytodoinsciencefiction).Anexperiencedwriterknowsthatthestoryisneveraboutthethings;itsaboutthepeople.Geneticswillhaveaverylargeimpactonourlives,butImnotsosureitwilldwarfthecomputerrevolution(whichenablesthegeneticrevolution)oratleasttheinformationrevolution.Informationisabouttalkingtoeachother:yes,carsandshoesandespeciallygeneticcuresareimportant,butintheendthosearejusttrappings.Whattrulymattersishowwerelatetotheworld.Andsomuchofthatisaboutcommunication.Thisbookisacaseinpoint.AmajorityoffolksthoughtIwasveryboldoralittlecrazytoputtheentirethingupontheWeb.“Whywouldanyonebuyit?”theyasked.IfIhadbeenofamoreconservativenatureIwouldnthavedoneit,butIreallydidntwanttowriteanothercomputerbookinthesameoldway.IdidntknowwhatwouldhappenbutitturnedouttobethesmartestthingIveeverdonewithabook.Foronething,peoplestartedsendingincorrections.Thishasbeenanamazingprocess,becausefolkshavelookedintoeverynookandcrannyandcaughtbothtechnicalandgrammaticalerrors,andIvebeenabletoeliminatebugsofallsortsthatIknowwouldhave1otherwiseslippedthrough.Peoplehavebeensimplyterrificaboutthis,veryoftensaying“Now,Idontmeanthisinacriticalway.”andthengivingmeacollectionoferrorsImsureIneverwouldhavefound.Ifeellikethishasbeenakindofgroupprocessandithasreallymadethebookintosomethingspecial.ButthenIstartedhearing“OK,fine,itsniceyouveputupanelectronicversion,butIwantaprintedandboundcopyfromarealpublisher.”Itriedveryhardtomakeiteasyforeveryonetoprintitoutinanicelookingformatbutthatdidntstemthedemandforthepublishedbook.Mostpeopledontwanttoreadtheentirebookonscreen,andhaulingaroundasheafofpapers,nomatterhownicelyprinted,didntappealtothemeither.(Plus,Ithinkitsnotsocheapintermsoflaserprintertoner.)Itseemsthatthecomputerrevolutionwontputpublishersoutofbusiness,afterall.However,onestudentsuggestedthismaybecomeamodelforfuturepublishing:bookswillbepublishedontheWebfirst,andonlyifsufficientinterestwarrantsitwillthebookbeputonpaper.Currently,thegreatmajorityofallbooksarefinancialfailures,andperhapsthisnewapproachcouldmakethepublishingindustrymoreprofitable.Thisbookbecameanenlighteningexperienceformeinanotherway.IoriginallyapproachedJavaas“justanotherprogramminglanguage,”whichinmanysensesitis.ButastimepassedandIstudieditmoredeeply,IbegantoseethatthefundamentalintentionofthislanguageisdifferentfromalltheotherlanguagesIhaveseen.Programmingisaboutmanagingcomplexity:thecomplexityoftheproblemyouwanttosolve,laiduponthecomplexityofthemachineinwhichitissolved.Becauseofthiscomplexity,mostofourprogrammingprojectsfail.Andyet,ofalltheprogramminglanguagesofwhichIamaware,noneofthemhavegoneall-outanddecidedthattheirmaindesigngoalwouldbetoconquerthecomplexityofdevelopingandmaintainingprograms1.Ofcourse,manylanguagedesigndecisionsweremadewithcomplexityinmind,butatsomepointtherewerealwayssomeotherissuesthatwereconsideredessentialtobeaddedintothemix.Inevitably,thoseotherissuesarewhatcauseprogrammerstoeventually“hitthe2wall”withthatlanguage.Forexample,C+hadtobebackwards-compatiblewithC(toalloweasymigrationforCprogrammers),aswellasefficient.ThosearebothveryusefulgoalsandaccountformuchofthesuccessofC+,buttheyalsoexposeextracomplexitythatpreventssomeprojectsfrombeingfinished(certainly,youcanblameprogrammersandmanagement,butifalanguagecanhelpbycatchingyourmistakes,whyshouldntit?).Asanotherexample,VisualBasic(VB)wastiedtoBASIC,whichwasntreallydesignedtobeanextensiblelanguage,soalltheextensionspileduponVBhaveproducedsometrulyhorribleandunmaintainablesyntax.Perlisbackwards-compatiblewithAwk,Sed,Grep,andotherUnixtoolsitwasmeanttoreplace,andasaresultisoftenaccusedofproducing“write-onlycode”(thatis,afterafewmonthsyoucantreadit).Ontheotherhand,C+,VB,Perl,andotherlanguageslikeSmalltalkhadsomeoftheirdesigneffortsfocusedontheissueofcomplexityandasaresultareremarkablysuccessfulinsolvingcertaintypesofproblems.WhathasimpressedmemostasIhavecometounderstandJavaiswhatseemslikeanunflinchinggoalofreducingcomplexityfortheprogrammer.Asiftosay“wedontcareaboutanythingexceptreducingthetimeanddifficultyofproducingrobustcode.”Intheearlydays,thisgoalhasresultedincodethatdoesntrunveryfast(althoughtherehavebeenmanypromisesmadeabouthowquicklyJavawillsomedayrun)butithasindeedproducedamazingreductionsindevelopmenttime;halforlessofthetimethatittakestocreateanequivalentC+program.Thisresultalonecansaveincredibleamountsoftimeandmoney,butJavadoesntstopthere.Itgoesontowrapallthecomplextasksthathavebecomeimportant,suchasmultithreadingandnetworkprogramming,inlanguagefeaturesorlibrariesthatcanattimesmakethosetaskstrivial.Andfinally,ittacklessomereallybigcomplexityproblems:cross-platformprograms,dynamiccodechanges,andevensecurity,eachofwhichcanfitonyourcomplexityspectrumanywherefrom“impediment”to“show-stopper.”Sodespitetheperformanceproblemsweveseen,thepromiseofJavaistremendous:itcanmakeussignificantlymoreproductiveprogrammers.3OneoftheplacesIseethegreatestimpactforthisisontheWeb.Networkprogramminghasalwaysbeenhard,andJavamakesiteasy(andtheJavalanguagedesignersareworkingonmakingiteveneasier).Networkprogrammingishowwetalktoeachothermoreeffectivelyandcheaperthanweeverhavewithtelephones(emailalonehasrevolutionizedmanybusinesses).Aswetalktoeachothermore,amazingthingsbegintohappen,possiblymoreamazingeventhanthepromiseofgeneticengineering.Inallwayscreatingtheprograms,workinginteamstocreatetheprograms,buildinguserinterfacessotheprogramscancommunicatewiththeuser,runningtheprogramsondifferenttypesofmachines,andeasilywritingprogramsthatcommunicateacrosstheInternetJavaincreasesthecommunicationbandwidthbetweenpeople.Ithinkthatperhapstheresultsofthecommunicationrevolutionwillnotbeseenfromtheeffectsofmovinglargequantitiesofbitsaround;weshallseethetruerevolutionbecausewewillallbeabletotalktoeachothermoreeasily:one-on-one,butalsoingroupsand,asaplanet.Ivehearditsuggestedthatthenextrevolutionistheformationofakindofglobalmindthatresultsfromenoughpeopleandenoughinterconnectedness.Javamayormaynotbethetoolthatfomentsthatrevolution,butatleastthepossibilityhasmademefeellikeImdoingsomethingmeaningfulbyattemptingtoteachthelanguage.Prefacetothe2ndeditionPeoplehavemademany,manywonderfulcommentsaboutthefirsteditionofthisbook,whichhasnaturallybeenverypleasantforme.However,everynowandthensomeonewillhavecomplaints,andforsomereasononecomplaintthatcomesupperiodicallyis“thebookistoobig.”Inmyminditisfaintdamnationindeedif“toomanypages”isyouronlycomplaint.(OneisremindedoftheEmperorofAustriascomplaintaboutMozartswork:“Toomanynotes!”NotthatIaminanywaytryingtocomparemyselftoMozart.)Inaddition,Icanonlyassumethatsuchacomplaintcomesfromsomeonewhoisyettobe4acquaintedwiththevastnessoftheJavalanguageitself,andhasnotseentherestofthebooksonthesubjectforexample,myfavoritereferenceisCayHorstmann&GaryCornellsCoreJava(Prentice-Hall),whichgrewsobigithadtobebrokenintotwovolumes.Despitethis,oneofthethingsIhaveattemptedtodointhiseditionistrimouttheportionsthathavebecomeobsolete,oratleastnonessential.IfeelcomfortabledoingthisbecausetheoriginalmaterialremainsontheWebsiteandtheCDROMthataccompaniesthisbook,intheformofthefreely-downloadablefirsteditionofthebook(atwww.BruceE).Ifyouwanttheoldstuff,itsstillthere,andthisisawonderfulreliefforanauthor.Forexample,youmaynoticethattheoriginallastchapter,“Projects,”isnolongerhere;twooftheprojectshavebeenintegratedintootherchapters,andtherestwerenolongerappropriate.Also,the“DesignPattens”chapterbecametoobigandhasbeenmovedintoabookofitsown(alsodownloadableattheWebsite).So,byallrightsthebookshouldbethinner.Butalas,itisnottobe.ThebiggestissueisthecontinuingdevelopmentoftheJavalanguageitself,andinparticulartheexpandingAPIsthatpromisetoprovidestandardinterfacesforjustabouteverythingyoudliketodo(andIwontbesurprisedtoseethe“JToaster”APIeventuallyappear).CoveringalltheseAPIsisobviouslybeyondthescopeofthisbookandisataskrelegatedtootherauthors,butsomeissuescannotbeignored.Thebiggestoftheseincludeserver-sideJava(primarilyServlets&JavaServerpages,orJSPs),whichistrulyanexcellentsolutiontotheWorldWideWebproblem,whereinwevediscoveredthatthevariousWebbrowserplatformsarejustnotconsistentenoughtosupportclient-sideprogramming.Inaddition,thereisthewholeproblemofeasilycreatingapplicationstointeractwithdatabases,transactions,security,andthelike,whichisinvolvedwithEnterpriseJavaBeans(EJBs).Thesetopicsarewrappedintothechapterformerlycalled“NetworkProgramming”andnowcalled“DistributedComputing,”asubjectthatisbecomingessentialtoeveryone.Youllalso5findthischapterhasbeenexpandedtoincludeanoverviewofJini(pronounced“genie,”anditisntanacronym,justaname),whichisacutting-edgetechnologythatallowsustochangethewaywethinkaboutinterconnectedapplications.AndofcoursethebookhasbeenchangedtousetheSwingGUIlibrarythroughout.Again,ifyouwanttheoldJava1.0/1.1stuffyoucangetitfromthefreely-downloadablebookatwww.BruceE(itisalsoincludedonthiseditionsnewCDROM,boundintothebook;moreonthatalittlelater).AsidefromadditionalsmalllanguagefeaturesaddedinJava2andcorrectionsmadethroughoutthebook,theothermajorchangeisinthecollectionschapter(9),whichnowfocusesontheJava2collectionsusedthroughoutthebook.Ivealsoimprovedthatchaptertomoredeeplygointosomeoftheimportantissuesofcollections,inparticularhowahashfunctionworks(sothatyoucanknowhowtoproperlycreateone).Therehavebeenothermovementsandchanges,includingarewriteofChapter1,andremovalofsomeappendicesandothermaterialthatIconsidernolongernecessaryfortheprintedbook,butthosearethebulkofthem.Ingeneral,Ivetriedtogoovereverything,removefromthe2ndeditionwhatisnolongernecessary(butwhichstillexistsintheelectronicfirstedition),includechanges,andimproveeverythingIcould.Asthelanguagecontinuestochangealbeitnotquiteatthesamebreakneckpaceasbeforetherewillnodoubtbefurthereditionsofthisbook.Forthoseofyouwhostillcantstandthesizeofthebook,Idoapologize.Believeitornot,Ihaveworkedhardtokeepitsmall.Despitethebulk,Ifeelliketheremaybeenoughalternativestosatisfyyou.Foronething,thebookisavailableelectronically(fromtheWebsite,andalsoontheCDROMthataccompaniesthisbook),soifyoucarryyourlaptopyoucancarrythebookonthatwithnoextraweight.Ifyourereallyintoslimmingdown,thereareactuallyPalmPilotversionsofthebookfloatingaround.(OnepersontoldmehewouldreadthebookinbedonhisPalmwiththebacklightingontokeepfromannoyinghiswife.Icanonlyhopethatithelpssendhimtoslumberland.)Ifyouneeditonpaper,Iknowof6peoplewhoprintachapteratatimeandcarryitintheirbriefcasetoreadonthetrain.Java2Atthiswriting,thereleaseofSunsJavaDevelopmentKit(JDK)1.3isimminent,andtheproposedchangesforJDK1.4havebeenpublicized.Althoughtheseversionnumbersarestillinthe“ones,”thestandardwaytorefertoanyversionofthelanguagethatisJDK1.2orgreateristocallit“Java2.”Thisindicatestheverysignificantchangesbetween“oldJava”whichhadmanywartsthatIcomplainedaboutinthefirsteditionofthisbookandthismoremodernandimprovedversionofthelanguage,whichhasfarfewerwartsandmanyadditionsandnicedesigns.ThisbookiswrittenforJava2.Ihavethegreatluxuryofgettingridofalltheoldstuffandwritingtoonlythenew,improvedlanguagebecausetheoldinformationstillexistsintheelectronic1steditionontheWebandontheCDROM(whichiswhereyoucangoifyourestuckusingapre-Java-2versionofthelanguage).Also,becauseanyonecanfreelydownloadtheJDK,itmeansthatbywritingtoJava2Imnotimposingafinancialhardshiponsomeonebyforcingthemtoupgrade.Thereisabitofacatch,however.JDK1.3hassomeimprovementsthatIdreallyliketouse,buttheversionofJavathatiscurrentlybeingreleasedforLinuxisJDK1.2.2.Linux(seewww.L)isaveryimportantdevelopmentinconjunctionwithJava,becauseitisfastbecomingthemostimportantserverplatformouttherefast,reliable,robust,secure,well-maintained,andfree,atruerevolutioninthehistoryofcomputing(Idontthinkweveeverseenallofthosefeaturesinanytoolbefore).AndJavahasfoundaveryimportantnicheinserver-sideprogrammingintheformofServlets,atechnologythatisahugeimprovementoverthetraditionalCGIprogramming(thisiscoveredinthe“DistributedProgramming”chapter).SoalthoughIwouldliketoonlyusetheverynewestfeatures,itscriticalthateverything7compilesunderLinux,andsowhenyouunpackthesourcecodeandcompileitunderthatOS(withthelatestJDK)youlldiscoverthateverythingwillcompile.However,youwillfindthatIveputnotesaboutfeaturesinJDK1.3hereandthere.TheCDROMAnotherbonuswiththiseditionistheCDROMthatispackagedinthebackofthebook.IveresistedputtingCDROMsinthebackofmybooksinthepastbecauseIfelttheextrachargeforafewKbytesofsourcecodeonthisenormousCDwasnotjustified,preferringinsteadtoallowpeopletodownloadsuchthingsfrommyWebsite.However,youllsoonseethatthisCDROMisdifferent.TheCDdoescontainthesourcecodefromthebook,butitalsocontainsthebookinitsentirety,inseveralelectronicformats.MyfavoriteoftheseistheHTMLformat,becauseitisfastandfullyindexedyoujustclickonanentryintheindexortableofcontentsandyoureimmediatelyatthatportionofthebook.Thebulkofthe300+MegabytesoftheCD,however,isafullmultimediacoursecalledThinkinginC:FoundationsforC+&Java.IoriginallycommissionedChuckAllisontocreatethisseminar-on-CDROMasastand-aloneproduct,butdecidedtoincludeitwiththesecondeditionsofbothThinkinginC+andThinkinginJavabecauseoftheconsistentexperienceofhavingpeoplecometoseminarswithoutanadequatebackgroundinC.Thethinkingapparentlygoes“ImasmartprogrammerandIdontwanttolearnC,butratherC+orJava,soIlljustskipCandgodirectlytoC+/Java.”Afterarrivingattheseminar,itslowlydawnsonfolksthattheprerequisiteofunderstandingCsyntaxisthereforaverygoodreason.ByincludingtheCDROMwiththebook,wecanensurethateveryoneattendsaseminarwithadequatepreparation.TheCDalsoallowsthebooktoappealtoawideraudience.EventhoughChapter3(Controllingprogramflow)doescoverthefundamentalsofthepartsofJavathatcomefromC,theCDisagentlerintroduction,andassumesevenlessaboutthestudentsprogramming8backgroundthandoesthebook.ItismyhopethatbyincludingtheCDmorepeoplewillbeabletobebroughtintothefoldofJavaprogramming.中文翻译JAVA思想第二版前言我想起我的兄弟TODD,他正从硬件领域大跃进到程序设计领域。基因工程是将下一个大革命的战场。我们将拥有许多被设计用来制造食物,燃料,塑胶,的各类微生物;这些微生物的出现,可以免去污染,让我们仅付出远少于现今所付出的代价,便足以主宰整个物质世界。我原以为,这场革命规模之大,将使电脑革命相形见拙。然而,后来,我发觉我犯了科幻作家所犯的同样错误:对科技的迷失(当然,这在咳幻小说中屡见不鲜)。有经验的作家都知道,故事的重点不在技术,而在于人。基因工程无疑会对我门的生活造成极大冲击,但是我不确定它是否会阻碍电脑革命(电脑革命也带动了基因工程的到来)或至少说是资讯革命。所谓资讯,关注的是人际之间的沟通。是的,车字,鞋子,尤其是基因治疗,都很重要,但这些东西最终都和陷阱没什么两样。人类与世界共处的方式,才是真正关键所在。而这其中,沟通居重要角色。本书是一个例子。大多数人认为我很大胆,或者说有点疯狂,因为我把所有材料都放在了WEB上。“那么,还有什么购买的理由呢?”他们这样问我。如果我的性格保守谨慎一些,我句不会这么做了。但是我真的不想在用同样老旧的方式来撰写译本新的电脑书籍。我不知道回发生什么事情,但事实证明这是我对书籍所做过的最棒的一件事情。首先,人们开始把校正结果送回。这是个让人惊叹的过程,因为人们仔细端详每个角落,每个缝隙,找出技术上和文法上的种种错误,让我得以更进一步消除所有毛病,而这些毛病原本是被我遗漏未察觉到的。人们往往对这种做法表示惊恐,他们常常说“吾,我不确定我这么做是否过于吹毛求疵”,然后仍给我一大堆错误。我发誓,我自己从未曾察觉这些错误。我很喜欢这种参与的过程,这个过程也使这本书更加独特。但是,接着我开始听到“嗯,很好。整个电子版都能够放到网络上实在不错,可是我希望拥有出版打印出来的,装订成册的纸本。”我曾经努力让每个人能够更轻松地以美观的方式把它印出来,但这么做似乎还是无法满足对此书的要求。大部分人都不希望在电脑屏幕上读完一整本书,也不希望总是拖着一捆捆的纸。即便这些纸张印刷在美观,对他们来说也不具有半点吸引力(而且我想激光打印机的碳粉也不便宜)。即使是电脑革命,似乎也难以削减出版商的生意。不过,某个学生提出了一种看法,他认为这也许会成为未来的一种出版模型:现在WEB上公开书籍内容,只有在吸引了足9够关注是,才考虑制作纸本形式。目前,绝大多数书籍不赚钱,这种做法或许可以让整个出版产业更有利润一些。这本书一另一种形式对我产生了启迪。一开始我把Java定位在“只不过是另一种程序语言”。从许多角度来看的确如此。但是随着时间流逝。对Java的学习日深,我开始这种程序语言的根本目的,和其他我所见过的程序语言有着极大的不同。程序设计,就是对复杂度的控制。复杂度包括待解决问题的复杂度和底层机器的复杂度。因为有着这样子的复杂度,所以大多数程序开发案例都失败了。到目前为止,所有我知道的程序语言,没有一个竭尽所能地将主要实际目标锁定在:“克服程序发展与维护过程中的种种复杂度上”。当然。许多程序语言当初设计时也曾将复杂度考虑进去,但是总有被视为更本质的问题混杂进来,毫无疑问,那些问题也都是回让语言使用者一筹莫展的问题。举例来说:C+向下兼容于C(为使熟悉C的程序员得以比较轻松的跨越门槛),并担负起C+成败的重大责任。不过,两者也带来了额外的复杂度,使得某些案例无法完成。(通常你可以将此点归罪与程序开放人员或管理人员,不过如果是某个语言可以协助我们捕捉错误,何乐不为?)VisualBasic(VB)是另一个例子,它被BASIC这个“其实不以扩充性为设计目标”的语言局限住,使的所有强硬堆于VB之上的扩充功能,都造成了可怕至极且难以维护的语法。Perl也向下兼容与Awk,Sed,Grep,以及其他诸如此类它想取代的Unix工具,于是衍生出诸如“能写却不能读”的程序代码(write_onlycode),这种指责(意思是,写完之后的数个月内,你都还是无法阅读它)。另一方面,C+,VB,Perl,Smalltalk之类的程序语言,都在复杂度议题上有着相当程度的著墨,十分成功地解决了某些类型的问题。当我了解Java之后,最叫我感动的,莫过于Java似乎把“为程序员降低复杂度”做为一个固定的目标。就好像是说:“我们唯一考虑,就是要降低稳固程序代码的产生时间和困难度”。早期,这个目标只开花结果于程序代码的书写上,但这些程序代码却无法执行的很快(虽然目前有许多保证,承诺Java总有一天能够执行的多快多快)。但是Java的确出人意料地答复缩短了发展时间;比起发展等价的C+来说,大概只需一半或甚至更少时间。光是这个结果,就足以省下惊人的时间与金钱。不过,Java并未停止脚步。Java继续将多执行线程,网络程序设计等等复杂而重要的工作包装起来。透过语言本身的性质以及程序库,有时能够使这些工作变得轻而易举。最后一点,Java着眼于某些有着极高复杂度的问题:跨平台程序,动态程序代码改变,安全问题,其中每一个问题都能够套用在整个复杂度频谱的任何一点上。所以尽管有着众所周知的效率问题,Java带来的保证却是很棒的:可以让我们成为具有高生产力的程序员。我所见到的种种巨幅改变,有一些是发生在Web身上。网络程序设计一直都不是件简单的事情,但是Java把它变的简单了。(而Java语言设计者仍旧继续努力使它变得更简单)。网络程序设计所讨论的,便是让我们以更有效的,成本更低的方式,和其他人通讯,超越旧式的电话媒介(但是电子邮件便已经革命性地改变了许多事情)。当我们能够在与他人沟通这件事情行上着力更多,神奇的事情便会开始发生,或许甚至比基因工程所许诺的远景,更让人感到神奇。透过所有。努力程序开发,团对开发,用户界面的设计(让程序可以和使用者互动),跨平台的执行,跨Internet(网际网,互连网)通讯程序开发的大量简化Java扩展了“人际之间”的通讯频宽。我认为通讯革命的成果或许不应该只是围绕在传输频宽提高后所产生的效率上打转;我们将会看到货真价实的革命,因为我们能够更10轻松地和其他人沟通:可以是一对一的形式,可以是群体通讯的形式,也可以是和全地球人通讯的形式。我曾经听人主张,接下来的革命会是一种全球意志的形成,来自于足够数量的人们和足够数量的相互联系。Java可能是,也可能不是点起这把燎原之火的火焰,但至少存在着可能。这使我觉得,这个语言的教学是一件有意义的事情。第二版前言关于本书的第一版,人们给了我许多精彩的意见。我当然对此感到非常愉快。不过有时侯读者也有抱怨。一个常常被提起的抱怨是:这本书太大了。多我来说,如果“页数过多”的确是你唯一的怨言,那真是一个让人无言以对的责难。(这让人想起澳地利皇帝对莫扎特作品的非难:“音符太多了!”当然我并不是将自己拿来和莫扎特相提并论)我只能够假设,这样的怨言出自于一个“被塞进太多Java语言的广阔内容,而还未看过其他相同主题的书籍)的人。就拿我最喜欢的一本参考书来说好了,他是CayHorstmann和GaryCornell合著的coreJava(Prentice-Hall出版)起规模甚至大到必须拆成两册。尽管如此,在这一(第二)版本中,我努力尝试的事情之一,便是修剪过时的内容,或至少不是那么必要的内容。这么做我觉得很自在,因为原先内容仍然摆在网站www.BruceE上,而且本书所附光碟中也有第一版的内容。如果你想取得原本内容,没有任何问题,这对作者而言也是一种欣慰。举个例子,你可能会发现第一版的最后一章“工程(Projects)”已不复存在;有两个工程被整合到其他章节里头,因此剩余部分也就变得不再适合存在。同样的,“程序设计(DesignPatters)”这一章的内容变得更丰富了,因此也独立成册了(可从我的网站上下载)。基于这些原因,本书理应变得苗条一些。事实却非如此。最大的问题是,Java语言本身仍在持续发展当中,企图为所有可能用到的东西提供标准化的界面,因此API的数量不断扩大。所以就算看到Jtoaster这样的API出现,我也不会吃惊(译注:toaster是烤面包机器,Jtoaster意指标准化的烤面包机器类别。连烤面包机器都有类别,借此夸张地修饰Java2所涵盖的类别的广泛程度)。“涵盖所有API”似乎逾越本书的范围,应该交给其他作者完成,但尽管如此,仍然有某些问题难以省略去。服务器端Java(主要是Servlets和JavaServerpages)便是这些问题中涵盖最广的一个。服务器端Java无疑为WWW的诸多问题提供了出色的解决方案。尤其当我们发现“现存许多有不同的Web浏览器平台,无法提供一致的用户端程序开发”时,更显示其重要性,此外EnterpriseJavaBeans(EJBs)的问世,也让人们希望更轻易地发展资料连结,交易处理,安全考虑。这些问题在本书的第一版本中通通被放进“网络程序设计”一章。本版本改用了一个对每个人来说都愈
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 2025化工企业环境保护专项集体合同
- 2025铝合金门窗制造合同协议书
- 2025共同责任担保借款合同范本
- 2025年安徽省滁州市南谯区中考三模语文试题
- 航空业飞行员培训与飞机维修维护方案
- 新能源技术应用案例分析卷
- 动物保护话题演讲-演讲稿15篇
- 爸爸的自行车关于父爱的物品描写9篇范文
- 餐饮服务食品质量与卫生保障协议
- 2025办公设备维护服务合同范本
- 公开课虚拟语气在if条件句中的用法课件市公开课一等奖省赛课微课金奖课件
- 保密工作培训
- 美学与人生智慧树知到期末考试答案2024年
- 2024火电厂智能巡检机器人系统应用
- 菌种转让合同
- 消化内镜检查前胃肠道准备课件
- 外科总论测试题与答案
- 浙江省杭州市上城区2022-2023学年五年级下学期期末学业水平监测数学卷
- 特种水产养殖学课件
- 新苏教版科学六年级下册全册教案(含反思)
- 高中物理必修第1册教材习题答案
评论
0/150
提交评论