您好,欢迎访问三七文档
当前位置:首页 > 商业/管理/HR > 其它文档 > Java语言程序设计基础篇全习题答案1
1.2.3.4.Chapter1IntroductiontoComputers,Programs,andJavaAcomputerisanelectronicdevicethatstoresandprocessesdata.Acomputerincludesbothhardwareandsoftware.Ingeneral,hardwareisthephysicalaspectofthecomputerthatcanbeseen,andsoftwareistheinvisibleinstructionsthatcontrolthehardwareandmakeitwork.ThehardwareofacomputerconsistsofaCPU,cache,memory,harddisk,floppydisk,monitor,printer,andcommunicationdevices.Themachinelanguageisasetofprimitiveinstructionsbuiltintoeverycomputer.Assemblylanguageisalow-levelprogramminglanguageinwhichamnemonicisusedtorepresenteachofthemachinelanguageinstructions.Thehigh-levellanguagesareEnglish-likeandeasytolearnandprogram.Theoperatingsystem(OS)isaprogramthatmanagesandcontrolsacomputer’sactivities.TheexamplesofOSareWindows98,NT,2000,XP,orME.Windows.ApplicationprogramssuchasanInternetbrowserandawordprocessorrunontopofanoperatingsystem.100indecimal=64inhex100indecimal=01100100inbinary4340indecimal=10F4inhex4340indecimal=1000011110100inbinary2000indecimal=7D0inhex2000indecimal=111110100005.1000011001inbinary=219inhex1000011001inbinary=537indecimal100000000inbinary=100inhex100000000inbinary=256indecimal100111inbinary=27inhex100111inbinary=39indecimal6.FEFA9inhex=1044393indecimalFEFA9inhex=11111110111110101001inbinary93inhex=147indecimal93inhex=10010011inbinary2000inhex=8192indecimal7.8.9.10.11.12.13.14.16.17.2000inhex=10000000000000inbinaryDevelopedbyateamledbyJamesGoslingatSunMicrosystemsin1991.OriginallycalledOak,itbecameJavain1995whenitwasredesignedfordevelopingInternetapplications.JavacanrunonanyplatformwithaJavaVirtualMachine.TheminimumrequirementistheJavaRuntimeEnvironment,freefromthe(ifcompiledsuccessfully).JBuilderbyBorland,SunONEStudiobySun,CafébyWebGain,VisualAgeforJavabyIBMarethetoolsfordevelopingJavaprograms,notdialectsofJava.ThesetoolsmakedevelopingJavaprogramseasierandmoreproductive.HTMLisamarkuplanguagefordisplayingstaticWebpages.Javaisafull-fledgedprogramminglanguagethatcanbeusedtodevelopdynamicWebpages.TheJavaprogramsthatrunfromaWebbrowserarecalledapplets.JavaappletsmustbeembeddedinHTMLfilesusingtheapplettag.Keywordshavespecificmeaningtothecompilerandcannotbeusedforotherpurposesintheprogramsuchasvariablesormethodnames.Examplesofkeywordsareclass,static,andvoid.Javasourcecodeiscasesensitive.Javakeywordsarealwaysinlowercase.Thesourcefileextensionis.javaandthebytecodefileextensionis.class.Commentsareusedtodocumentwhataprogramisforandhowaprogramisconstructed.Commentshelptheprogrammersoruserstocommunicateandunderstandtheprogram.Commentsarenotprogrammingstatementsandareignoredbythecompiler.InJava,commentsareprecededbytwoforwardslashes(//)inalineorenclosedbetween/*and*/inmultiplelines.Whenthecompilersees//,itignoresalltextafter//inthesameline.Whenitsees/*,itscansforthenext*/andignoresanytextbetween/*and*/.15.System.out.println(...);JOptionPane.showMessageDialog(null,“Helloworld”);Line2.Mainshouldbemain.Line2.staticismissing.Line3:WelcometoJava!shouldbeenclosedinsidedoublequotationmarks.javacistheJDKcommandtocompileaprogramprogram.javaistheJDKcommandtorunaprogram.18.19.Javainterpretercannotfindthe.classfile.Makesureyouplacedthe.classintherightplace,andinvokedjavacommandwithappropriatepackagename.Theclassdoesnothaveamainmethod,orthesignatureofthemainmethodisincorrect.ThankyouforevaluatingAdreamSoftPDFtoWordYoucanonlyconvert3pageswiththetrialversionTogetallthepagesconverted,youneedtopurchasethesoftwarefrom
本文标题:Java语言程序设计基础篇全习题答案1
链接地址:https://www.777doc.com/doc-4270711 .html