【正文】
eption e){n(“caught ” + e)。}}}choices:what is the result when you pile and run the following code?public class throwsdemo{static void throwmethod(){n(“inside throwmethod.”)。throw new illegalaccessexception(“demo”)。}public static void main(string args[]){try{throwmethod()。}catch(illegalaccessexception e){n(“caught ” + e)。}}}choices:ation errore errore successfully, nothing is ed by caught:laccessexcption: demo8:which of the following statements are not legal?l = 4990。i = 4l。d = 。t = :give the following java class:public class example{public static void main(string args[]){static int x[] = new int[15]。n(x[5])。}}which statement is corrected?give the following java class:public class example{public static void main(string args[]){static int x[] = new int[15]。n(x[5])。}}which statement is corrected?pile, some error will run, some error will is is :下面關(guān)于變量及其范圍的陳述哪些是錯(cuò)的。11:public class x{public object m(){object o = new float()。//line 3object [] oa = new object[1]。//line 4oa[0] = o。//line 5o=null。//line 6return oa[0]。//line 7}}when is the float object, created in line 3,eligible for garbage collection?public class x{public object m(){object o = new float()。//line 3object [] oa = new object[1]。//line 4oa[0] = o。//line 5o=null。//line 6return oa[0]。//line 7}}when is the float object, created in line 3,eligible for garbage collection?after line after line 6after line 7(that is,as the method returns)in this method12:which is the most appropriate code snippet that can be inserted at line 18 in the following code?(assume that the code is piled and run with assertions enabled).*。class asserttest4.{e hashmap cctld。asserttest()8.{= new hashmap()。(“in”, “india”)。(“uk”, “united kingdom”)。(“au”, “australia”)。13.// more code...14.}15.// other methods.... string getcountry(string countrycode)17.{18.// what should be inserted here?country =(string)(countrycode)。country。21.}22.}which is the most appropriate code snippet that can be inserted at line 18 in the following code?(assume that the code is piled and run with assertions enabled).*。class asserttest4.{e hashmap cctld。asserttest()8.{= new hashmap()。(“in”, “india”)。(“uk”, “united kingdom”)。(“au”, “australia”)。13.// more code...14.}15.// other methods.... string getcountry(string countrycode)17.{18.// what should be inserted here?country =(string)(countrycode)。country。21.}22.}countrycode!= null。countrycode!= null : “country code can not be null”。cctld!= null : “no country code data is available”。cctld : “no country code data is available”。13:give the following code:public class example{public static void main(string args[]){int l=0。do{n(“doing it for l is:”+l)。}while(—l0)n(“finish”)。}}which well be output:give the following code:public class example{public static void main(string args[]){int l=0。do{n(“doing it for l is:”+l)。}while(—l0)n(“finish”)。}}which well be output:it for l is 3it for l is 1it for l is 2it for l is 014:which statements about java code security are not true?bytecode verifier loads all classes needed for the execution of a ing code is performed by the runtime runtime the bytecodes are loaded, checked and run in an interpreter. class loader adds security by separating the namespaces for the classes of the local file system from those imported from network :a class design requires that a member variable should be accessible only by same package, which modifer word should be used?tedmodifere16:character流與byte流的區(qū)別是,后者沒(méi)有,后者是字節(jié)讀寫,可以互換使用簡(jiǎn)答題17:找出兩個(gè)字符串中最大子字符串,如“abractyeyt”,“dgdsaeactyey”的最大子串為“actyet”18:假設(shè)你有一個(gè)用1001個(gè)整數(shù)組成的數(shù)組,這些整數(shù)是任意排列的,但是你知道所有的整數(shù)都在1到1000(包括1000)之間。此外,除一個(gè)數(shù)字出現(xiàn)兩次外,其他所有數(shù)字只出現(xiàn)一次。假設(shè)你只能對(duì)這個(gè)數(shù)組做一次處理,用一種算法找出重復(fù)的那個(gè)數(shù)字。如果你在運(yùn)算中使用了輔助的存儲(chǔ)方式,那么你能找到不用這種方式的算法嗎?19:到底在哪里使用cascade=“...”?20:使用tomcat部署應(yīng)用程序 emoryerror 嗎?如何解決的。21:請(qǐng)寫一個(gè)java程序?qū)崿F(xiàn)數(shù)據(jù)庫(kù)緩沖池的功能?22:有200個(gè)正整數(shù),且每個(gè)數(shù)均在1000至9999之間。請(qǐng)編制函數(shù),其函數(shù)的功能是:要求按每個(gè)數(shù)的后三位的大小進(jìn)行升序排列,然后取出滿足此條件的前10個(gè)數(shù)依次存入數(shù)組bb中,如果后三位的數(shù)值相等,則按原先的數(shù)值進(jìn)行降序排列。23:anonymous inner class(匿名內(nèi)部類)是否可以extends(繼承)其它類,是否可以implements(實(shí)現(xiàn))interface(接口)?24:找出字符串a(chǎn)中包含的字符可以進(jìn)行的所有不同組合。例如:abccd中,ab,ac,bc,cc,abd等都是可能的組合。25:下面的代碼在絕大部分時(shí)間內(nèi)都運(yùn)行得很正常,請(qǐng)問(wèn)在什么情況下會(huì)出現(xiàn)問(wèn)題?問(wèn)題的根源在哪里?import .linkedlist。public class stack {linkedlist list = new linkedlist()。public synchronized void push(object x){synchronized(list){t(x)。notify()。}}public synchronized object pop()throws exception {synchronized(list){if(()= 0){wait()。}return last()。}}}