资源描述:
《java毕业设计外文文献原文及译文》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库。
1、毕业设计说明书英文文献及中文翻译学号:学号:软件学院学生姓名:软件工程学院:专业:指导教师:2014年6月第7页共7页ThinkinginJavaAlthoughitisbasedonC++,Javaismoreofa“pure”object-orientedlanguage.BothC++andJavaarehybridlanguages,butinJavathedesignersfeltthatthehybridizationwasnotasimportantasitwasinC++.Ahyb
2、ridlanguageallowsmultipleprogrammingstyles;thereasonC++ishybridistosupportbackwardcompatibilitywiththeClanguage.BecauseC++isasupersetoftheClanguage,itincludesmanyofthatlanguage’sundesirablefeatures,whichcanmakesomeaspectsofC++overlycomplicated.TheJava
3、languageassumesthatyouwanttodoonlyobject-orientedprogramming.Thismeansthatbeforeyoucanbeginyoumustshiftyourmindsetintoanobject-orientedworld(unlessit’salreadythere).Thebenefitofthisinitialeffortistheabilitytoprograminalanguagethatissimplertolearnandto
4、usethanmanyotherOOPlanguages.Inthischapterwe’llseethebasiccomponentsofaJavaprogramandwe’lllearnthateverythinginJavaisanobject,evenaJavaprogram.Eachprogramminglanguagehasitsownmeansofmanipulatingdata.Sometimestheprogrammermustbeconstantlyawareofwhattyp
5、eofmanipulationisgoingon.Areyoumanipulatingtheobjectdirectly,orareyoudealingwithsomekindofindirectrepresentation(apointerinCorC++)thatmustbetreatedwithaspecialsyntax?AllthisissimplifiedinJava.Youtreateverythingasanobject,usingasingleconsistentsyntax.A
6、lthoughyoutreateverythingasanobject,theidentifieryoumanipulateisactuallya“reference”toanobject.Youmightimaginethissceneasatelevision(theobject)withyourremotecontrol(thereference).Aslongasyou’reholdingthisreference,youhaveaconnectiontothetelevision,but
7、whensomeonesays“changethechannel”or“lowerthevolume,”whatyou’remanipulatingisthereference,whichinturnmodifiestheobject.Ifyouwanttomovearoundtheroomandstillcontrolthetelevision,youtaketheremote/referencewithyou,notthetelevision.Also,theremotecontrolcans
8、tandonitsown,withnotelevision.Thatis,justbecauseyouhaveareferencedoesn’tmeanthere’snecessarilyanobjectconnectedtoit.Soifyouwanttoholdawordorsentence,youcreateaStringreference:Buthereyou’vecreatedonlythereference,notanobject.Ifyoudecidedtosenda