資源描述:
《瑞海軟件java面試題new》由會員上傳分享,免費在線閱讀,更多相關(guān)內(nèi)容在工程資料-天天文庫。
1、瑞海軟件Java面試題1.談?wù)?和&&的區(qū)別2.數(shù)組有沒有l(wèi)ength()這個方法?String有沒有l(wèi)ength()這個方法?3.HashMap和Hashtable的區(qū)別4.Collection和Collections的區(qū)別5.Math.round(11.5)等於多少?Math.round(-11.5)等於多少?6.Strings=newString("xyz");創(chuàng)建了幾個StringObject?,分別是什么?7.error和exception有什么區(qū)別?8.abstract的method是否可同
2、時是static,是否可同時是native,是否可同時是synchronized?9.接口是否可繼承接口?抽象類是否可實現(xiàn)(implements)接口?抽象類是否可繼承實體類(concreteclass)?10.當(dāng)一個線程進入一個對象的一個synchronized方法后,其它線程是否可進入此對象的其它方法?11.try{}里有一個return語句,那么緊跟在這個try后的finally{}里的code會不會被執(zhí)行,什么時候被執(zhí)行,在return前還是后?12.問以下程序?qū)蛴〕鍪裁?父類package
3、test;publicclassFatherClass{publicFatherClass(){System.out.println("FatherClassCreate");}}子類:packagetest;importtest.FatherClass;publicclassChildClassextendsFatherClass{publicChildClass(){System.out.println("ChildClassCreate");}publicstaticvoidmain(String
4、[]args){FatherClassfc=newFatherClass();ChildClasscc=newChildClass();}}補充完善以下程序,以實現(xiàn)設(shè)計2個線程,其中兩個線程每次對j增加1,另外兩個線程對j每次減少1。對j增減的時候不需要考慮順序問題。WritetheSQLstatementsthatimplementthedatabaseschemathatcorrespondstothefollowingERmodel.Theentity“Child”isaweakentitywhi
5、chdependson“Employee”.Youranswershouldalsoincludethestatementoftherelevantintegrityconstraints.TheanswercanbegivenpurelyintermsoftwoCREATEstatements.答:Descriptionforthefollowingtwoquestions:Considerasmalldatabaseforalibrary.Thedatabasestoresgeneralinform
6、ationaboutbooks,thephysicalcopiesofeachbooktheyhaveinthelibrary,theirreadersandthebooks/copiesthatwereoraregivenoutonloan.Thisinformationisstoredinthefollowingrelations(primarykeysarerepresentedinboldunderlinedandforeignkeysinbolditalic(arrowsarealsodraw
7、nforforeignkeystoimprovereadability)):BookISBNtitleauthorspublisheryearpricePhysicalCopycatalogNoISBNlocationmaxDaysLoanoverdueChargePerDayReaderuserNamenameaddressmaxNoBooksForLoanLoanuserNamecatalogNodateOutdateInQuestion2[13]Expressthefollowingnatural
8、languagequeriesinSQL:a)Listthetitle,authors,andpriceforallthebookspublishedbyAddison-Wesleyin2000,inalphabeticalorderwithrespecttotitles.[2]b)Listthetitlesofallthebooksthatcanbetakenonloanformorethanthreedays.[2]c)Listhowm