JAVA编程思想英语参考文献与翻译
时间:2016-11-15 14:44来源:毕业论文
java基于c,但它是更纯的面向对象语言
“If we spoke a different language,wewouldperceiveasomewhatdifferentworld .”3670
Although it is based on C,Javaismoreofa「pure”对象-定向语言。
Both C and Java are hybrid languages, butinjavathedesignersfeltthatthehybridizationwasnotasimportantasitwasinc.ahybridlanguagealllage thereasoncishybridistosupportage HEC language.becausecisasupersetoftheclanguage,itincludesmanyofthatlanguage’sundesirablefeatures,whichcanmakesomesomeaspectore
thejavalanguageassumesthatyouwanttodoonlyobject-oriented programming.thismeansthatbeforeyoucanbeginyoumuststshiftyourmindsetiourmindsetindsetititetitiion . thebenefitofthisinitialeffortistheabilitytoprograminalanguagethatissimplertolearnandtousethanmanyotheroooplanguages.in this 在Java is an对象中进行mponentsofajavaprogramandlearnthat (almost ) everything。
youmanipulateobjectswithreferences
eachprogramminglanguagehasitsownmeansofmanipulatingelementsinmemory.sometimestheprogrammermustbeconstantlyawareofwhatypeofmory umanipulatingtheelementdirectly,orareyoudealingwithsomekindofindirectrepresentation (apointerincorc
allthisissimplifiedinjava.youtreateverythingasanobject, usingasingleconsistentsyntax.althoughyoutreateverythingasanobject theidentifieryoumanipulateisactuallya“reference”ton objjobja anda远程控制(the reference ).aslong asyou’reholdingthisreference,youhaveaconnectiontothetelevision, butwhensomeone“changethechannel”or“lowerthevolume,”what you’remanipulatingisthereference, whichinturnmodifiestheobject.ifyouwanttomovearoundtheroomandstillcontrolthetelevision,youtaketheremote/reference with you
Also,theremotecontrolcanstandonitsown,with no television. That is, justbecauseyouhaveareferencedoesn’tmeanthere’snecessarilyanobjectconnectedtoit.soifyouwanttoholdawordorsence,youcrecrecte
字符串s;
uther eyou’vecreatedonlythereference,not an object.ifyoudecidedtosendamessagetosatthispoint, you’llgetanerrorbecausesisn’tactuallyattachedtoanything (there’SnO television ).A safer practice,then,isAlwaystoinition
字符串s=' asdf ';
However,thisusesaspecialjavafeature 3360 stringscanbeinitializedwithquotedtext.normaly,youmustuseamoregeneraltypeofinitititition
You must create all the objects
When you create a reference,youwanttoconnectitwithanewobject.you doso,in general,withthenewoperator.thekeywordnewsays,“
strings=新字符串(asdf );
notonlydoesthismean makemeanewstring,butitalsogivesinformationabouthowtomakethestringbysupplyinganinitialcharacterstring
Of course, javacomeswithaplethoraofready-madetypesinadditiontostring.what’smoreimportantisthatyoucancreateyourowntypes.what’sthat ntalactivityinJavaprogramming,and it’s what you’llbelearningaboutintherestofthisbook。
where存储生命
it’susefultovisualizesomeaspectsofhowthingsarelaidoutwhiletheprogramisrunning—inparticularhowmemoryisarranged.there a refidouthed 0Java编程思想英语参考文献与翻译:http://www.lw free.com/fanyi/lunwen _ 71.html
---------分隔线---------------------------------------------------。