亚洲喷奶水中文字幕电影,日本aⅴ高清一区二区三区,欧美亚洲日本国产,欧美日韩亚洲中文字幕

<legend id="flx4p"><abbr id="flx4p"><thead id="flx4p"></thead></abbr></legend>

<mark id="flx4p"><thead id="flx4p"></thead></mark>

      android面試題

        android面試題由小編為大家搜集如下,僅供參考。

        1、下面異常是屬于Runtime Exception 的是(abcd)(多選)

        A、ArithmeticException

        B、IllegalArgumentException

        C、NullPointerException

        D、BufferUnderflowException

        解析:

        A、public class ArithmeticException extends RuntimeException

        當(dāng)出現(xiàn)異常的運(yùn)算條件時(shí),拋出此異常。例如,一個(gè)整數(shù)“除以零”時(shí),拋出此類的一個(gè)實(shí)例。

        B、public class IllegalArgumentException extends RuntimeException

        拋出的異常表明向方法傳遞了一個(gè)不合法或不正確的參數(shù)。

        C、public class NullPointerException extends RuntimeException

        空指針。

        D、public class BufferUnderflowException extends RuntimeException

        數(shù)組下溢異常。

        舉個(gè)例子:定義數(shù)組 a[10] ;即 a[0],a[1],a[2]...a[8],a[9] 一共十個(gè),上溢出指訪問(wèn)下標(biāo)小于0,下溢出訪問(wèn)下標(biāo)大于9.例如 a[-1],a[10]都是錯(cuò)的?傊痪湓 上溢出就是訪問(wèn)下標(biāo)小于0,下溢出是訪問(wèn)下標(biāo)大于等于數(shù)組長(zhǎng)度。

        2、Math.round(11.5)等于多少(), Math.round(-11.5)等于多少。( C )

        A、11 ,-11 B、11 ,-12 C、12 ,-11 D、12 ,-12

        解析:

        Math.round

        語(yǔ)法:

        Math.round(x);

        參數(shù):

        x 為一數(shù)值。

        解釋:

        方法。返回對(duì)參數(shù)x四舍五入后所得的整數(shù)近似值。

        再來(lái)看:math.round(-4.4)=-4;

        math.round(-4.5)=-4;

        math.round(4.4)=4;

        math.round(4.5)=5;

        如何解釋?

        4.3<4.4<4.5 so

        math.round(4.3)=4

        math.round(4.4)=4

        math.round(4.5)=5

        -4.6<-4.5 <-4.4 so

        math.round(-4.6)=-5

        math.round(-4.5)=-4

        math.round(-4.4)=-4

        -4.51 |-4.50 -4.49

        4.49 | 4.50 4.51

        因?yàn)槭秦?fù)數(shù),所以臨界點(diǎn)都是在5的左側(cè),文字上的“四舍五入”,讓人容易糊涂。

        3、下列程序段的輸出結(jié)果是:(b )

        void complicatedexpression_r(){

        int x=20, y=30;

        boolean b;

        b=x>50&&y>60||x>50&&y<-60||x<-50&&y>60||x<-50&&y<-60;

        System.out.println(b);

        }

        A、true B、false C、1 D、011.activity

        解析:b=x>50&&y>60||x>50&&y<-60||x<-50&& amp;y>60||x<-50&&y<-60,該表達(dá)式在判定x>50為假時(shí),就不會(huì)再對(duì)后面的表達(dá)式進(jìn)行計(jì)算了,因?yàn)?&& 運(yùn)算,只要有一方為false最終表達(dá)式就為false。

        4、對(duì)一些資源以及狀態(tài)的操作保存,最好是保存在生命周期的哪個(gè)函數(shù)中進(jìn)行(d)

        A、onPause() B、onCreate() C、 onResume() D、onStart()

        5、Intent傳遞數(shù)據(jù)時(shí),下列的數(shù)據(jù)類型哪些可以被傳遞(abcd)(多選)

        A、Serializable B、charsequence C、Parcelable D、Bundle

      本文已影響6827
      上一篇:asp.net面試題及答案 下一篇:Java集合面試問(wèn)題及答案

      相關(guān)文章推薦

      |||||