freepeople性欧美熟妇, 色戒完整版无删减158分钟hd, 无码精品国产vα在线观看DVD, 丰满少妇伦精品无码专区在线观看,艾栗栗与纹身男宾馆3p50分钟,国产AV片在线观看,黑人与美女高潮,18岁女RAPPERDISSSUBS,国产手机在机看影片

正文內(nèi)容

大公司面試問題集錦(已修改)

2025-04-06 00:22 本頁面
 

【正文】 各公司面試題華為的JAVA面試題(后記:沒有想到華為的面試題就是非同一般,很多題不是一眼就能夠看得出來,至少對我這種鳥來說是這樣。對我個人來說,看看這樣的題,可能比看《Think In Java》都還要好,因為這里面有很多的東西,都是我們平時沒有太在意,或者是只是懂一點皮毛而已,通過做一下這樣的練習(xí),把自己不知道、不熟悉的知識點,利用這個機會好好的鞏固一下。這些答案是我自己做的,有一些是從網(wǎng)上來的,有一部是自己做的,并且還有一部份沒有做完,我不敢保證都對,所以請你在引用的時候,務(wù)必通過自己核對一下。當然,我既然能夠把這些答案放在這里,那說明我肯定是自己檢驗了一遍的,也不是那么恐怖的)QUESTION NO: 1Public class Test1 { Public static void changeStr(String str){ str=wele。 } Public static void main(String[] args) { String str=1234。 changeStr(str)。 (str)。 }}//輸出結(jié)果:1234//這里雖然是一個靜態(tài)方法,但是里面的變量是一個局部變量,//所以這里不因為是靜態(tài)方法,就誤認為里面的變量也是靜態(tài)變量了QUESTION NO:2Public class Test2 { Static boolean foo(char c) { (c)。 Return true。 } Public static void main(String[] argv) { int i = 0。 //for(65。88amp。amp。(i2)。67) for (foo(39。A39。)。 foo(39。B39。) amp。amp。 (i 2)。 foo(39。C39。)) { i++。 foo(39。D39。)。 } }}/*What is the result?A. ABDCBDCBB. ABCDABCDC. Compilation fails.D. An exception is thrown at runtime.//輸出結(jié)果是:ABDCBDCB分析:FOR循環(huán)里面講究的條件要為真,與你的判斷式是什么沒有關(guān)系就像這里,雖然是打印的字母,但是卻不是false,所以可以執(zhí)行第一次進行循環(huán):foo(39。A39。)打印字母A,(注:這里不是false條件就默認為true條件)foo(39。B39。)打印字母B,i=0,比較(i 2),條件為true,進行循環(huán)體,foo(39。D39。)打印Dfoo(39。C39。)打印字母C第二次循環(huán):foo(39。B39。)打印B,i=1,比較(i 2)為true,進行循環(huán)體,foo(39。D39。)打印Dfoo(39。C39。)打印字母C第三次循環(huán):foo(39。B39。)打印字母B,i=2,比較(i 2)為false,退出循環(huán),得結(jié)果*/ QUESTION NO: 31. class A {2. protected int method1(int a, int b) { return 0。 }3. }Which two are valid in a class that extends class A? (Choose two)A. public int method1(int a, int b) { return 0。 }B. private int method1(int a, int b) { return 0。 }C. private int method1(int a, long b) { return 0。 }D. public short method1(int a, int b) { return 0。 }E. static protected int method1(int a, int b) { return 0。 }publicclass B extends A{ /***@paramargs */ //can not reduce the visibility of the inherited method from A //即不能夠使從類A中繼續(xù)來的方法的可見性降低 //private int method1(int a, int b) { return 0。 } //This static method cannot hide the instance method from A //靜態(tài)方法不能夠隱藏繼承于A的實例 //static protected int method1(int a, int b) { return 0。 } //返回類型與A中的該方法不一致 //public short method1(int a, int b) { return 0。 } /***總結(jié):類的繼承中,如果要想重載父類的方法,必須要和父類中的返回類型、可見性等等都要操作一致 *否則,程序就會報錯。一定遵守子類要遵從于父類的原則 *而我選擇的答案居然是privateintmethod1和staticprotectedint *我選擇第一個的錯誤理由是:因為原來為保護的,如果我這里設(shè)為public,那么就擴展了其原來的可見性 *本來原來就是對包外不可見的,現(xiàn)在變成對包外可見的了,所以就選擇的是private *選擇第二個的錯誤理由是:都是保護的,這里只是變成了靜態(tài)的而已*/ //這里是寫了一個重載方法,因為參數(shù)類型不一致,不會報錯 Private int method1(int a, long b) { return 0。 } //可見性可以增大,但是不能夠縮小,正確 Public int method1(int a, int b) { return 0。 } Public static void main(String[] args) { // TODO Autogenerated method stub }}QUESTION NO: 41. public class Outer{2. public void someOuterMethod() {3. // Line 34. }5. public class Inner{}6. public static void main( String[]argv ) {7. Outer o = new Outer()。8. // Line 89. }10. }Which instantiates an instance of Inner?A. new Inner()。 // At line 3B. new Inner()。 // At line 8C. new ()。 // At line 8D. new ()。 // At line 8//new Outer().new Inner()答案如下:publicclass Outer { publicvoid someOuterMethod() { // Line 3 new Inner()。//放在這里不出錯 } publicclass Inner { } publicstaticvoid main(String[] argv) { Outer o= new Outer()。 // Line 8 //o不能夠被解釋成為一種類型,出錯 //new ()。 /** *下面兩種用法,都報下面的錯誤: *NoenclosinginstanceoftypeOuterisaccessible. *Mustqualifytheallocationwithanenclosinginstance *oftypeOuter(()wherexisaninstanceofOuter) */ //new ()。 //new Inner()。 }} QUESTION NO: 5Which method is used by a servlet to place its session ID in a URL that is written to the servlet’s response output stream?(譯:那個方法是servlet用于將其session ID入在一個URL中,該URL寫入servlet的響應(yīng)輸出流)A. The encodeURL method of the HttpServletRequest interface.B. The encodeURL method of the HttpServletResponse interface.C. The rewriteURL method of the HttpServletRequest interface.D. The rewriteURL method of the HttpServletResponse interface.QUESTION NO: 6Which two are equivalent? (Choose two)A. %= %B. %= ()%C. %= (size)%D. jsp:getProperty id=YoshiBean param=size/E. jsp:getProperty name=YoshiBean param=size/F. jsp:getProperty id=YoshiBean property=size/G. jsp:getProperty name=YoshiBean property=size/QUESTION NO: 7Which of the following statements regarding the lifecycle of a session bean are correct? 1. is thrown if () is invoked when a stateful session bean instance is passivated. 2.() does not throw an exception when a session bean with beanmanaged transaction demarcation is activated. 3.An exception is not thrown when () is called in the afterBegin method of a bean with containermanaged transactions. 4.JNDI access to java:p/env is permitted in all the SessionSynchronization methods of a stateful session bean with containermanaged transaction demarcation.5.Accessing resource managers in the meth
點擊復(fù)制文檔內(nèi)容
環(huán)評公示相關(guān)推薦
文庫吧 www.dybbs8.com
公安備案圖鄂ICP備17016276號-1