




版權(quán)說(shuō)明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡(jiǎn)介
1、關(guān)關(guān)聯(lián)聯(lián)教教學(xué)學(xué)章章/ /課課時(shí)時(shí)1.1.試試題題正正文文2.2.難難度度3.3.區(qū)區(qū)分分度度4.4.分分?jǐn)?shù)數(shù)哪個(gè)命令可以編譯Java文件?易中3哪個(gè)命令可以運(yùn)行Java文件?易中3.java文件編譯后,將生成什么文件?易中3一個(gè)Java類,運(yùn)行時(shí)從哪個(gè)方法開始?易中3main方法的參數(shù)是什么類型?易中3Java語(yǔ)言中有指針么?易中3下面哪個(gè)標(biāo)識(shí)符不合法?易中5下面哪個(gè)類名不符合命名規(guī)范?易中5下面哪個(gè)不是關(guān)鍵字?易中5下列哪項(xiàng)不能直接寫到一個(gè)Java類中?易中3為了使一個(gè)名為MyClass的public類成功編譯,需要滿足一下哪個(gè)條件?易中3一下哪個(gè)關(guān)鍵字不能用于頂層類?易中3Java類聲明
2、中,哪項(xiàng)是可選的?易中5聲明Java類的關(guān)鍵字是哪個(gè)?易中5Java類體用哪個(gè)符號(hào)?易中5下面哪個(gè)標(biāo)識(shí)符是符合命名規(guī)范的Java類名?易中5可以使用哪個(gè)修飾符修飾類?易中5Java屬性聲明中,哪項(xiàng)是可選的?易中5Java類的屬性,不能用哪個(gè)修飾符?易中5Java類的屬性,聲明在什么地方?易中5下面哪個(gè)標(biāo)識(shí)符是符合命名規(guī)范的屬性名?易中5Java類聲明中,哪項(xiàng)是可選的?易中5下面哪個(gè)不是Java類方法的返回值類型?易中5方法體用哪個(gè)符號(hào)表示?易中5下面哪個(gè)標(biāo)識(shí)符是符合命名規(guī)范的方法名?易中5下面哪項(xiàng)的兩個(gè)方法,是一個(gè)類中的方法重載?易中5下面哪項(xiàng)不是方法重載的要求?易中5下面哪項(xiàng)是方法重載的作用
3、?易中5哪項(xiàng)是類A中正確的構(gòu)造方法聲明?易中5下面哪項(xiàng)不是構(gòu)造方法必須有的特性?易中5如何調(diào)用構(gòu)造方法?易中5構(gòu)造方法是否可以重載?易中5哪項(xiàng)是public class A中默認(rèn)構(gòu)造方法的聲明?易中5public class A中幾個(gè)構(gòu)造方法?易中5public class Apublic A(int x)中幾個(gè)構(gòu)造方法?易中51.public class A 2.public A(int x)3.public static void main(String args) 4.A a new A();5.6.運(yùn)行結(jié)果是什么?易中5對(duì)象用什么操作符調(diào)用屬性或方法?易中5Java類中如何創(chuàng)建對(duì)象?易
4、中5對(duì)象用什么操作符調(diào)用屬性或方法?易中5public class TestBlock private int x; System.out.println(實(shí)例塊); static System.out.println(靜態(tài)塊); public static void main(String args) new TestBlock(); new TestBlock(); 運(yùn)行結(jié)果是?易中5public class TestBlock private int x; System.out.println(實(shí)例塊); static System.out.println(靜態(tài)塊); public st
5、atic void main(String args) 運(yùn)行結(jié)果是?易中5對(duì)于內(nèi)部類,以下說(shuō)法錯(cuò)誤的是易中5對(duì)于以下代碼,請(qǐng)問(wèn)插入哪個(gè)語(yǔ)句可以訪問(wèn)到內(nèi)部類InsideOne?public class Example public static void main(String args) EnclosingOne eo=new EnclosingOne(); /插入語(yǔ)句處 class EnclosingOne public class InsideOne 易中5有關(guān)匿名內(nèi)部類的描述正確的是易中5以下哪些類型的變量可以被一個(gè)內(nèi)部類訪問(wèn)?易中5以下關(guān)于內(nèi)部類的描述哪些是正確的?易中5以下哪些是Ja
6、va中的關(guān)鍵字?易中5聲明包使用哪個(gè)關(guān)鍵字?易中5下面哪個(gè)是符合命名規(guī)范的包名?易中5使用哪個(gè)關(guān)鍵字導(dǎo)入其他包?易中5哪個(gè)包可以不導(dǎo)入直接使用?易中5要使用com.chinasofti包下所有類,哪條語(yǔ)句正確? 易中5關(guān)于Java源代碼文件,下列說(shuō)法錯(cuò)誤的是?中中5對(duì)于以下說(shuō)法,哪些是正確的?中中5類(外部類)可以使用哪個(gè)訪問(wèn)權(quán)限修飾符?易中5方法可以使用哪個(gè)訪問(wèn)權(quán)限修飾符?易中5屬性可以使用哪個(gè)訪問(wèn)權(quán)限修飾符?易中5構(gòu)造方法可以使用哪個(gè)訪問(wèn)權(quán)限修飾符?易中5只允許子類及同包類訪問(wèn)某方法,使用哪個(gè)修飾符?易中5如果類中的成員變量只可以被同一包訪問(wèn),則使用如下哪個(gè)約束符?易中5為了實(shí)現(xiàn)對(duì)屬性的封
7、裝,屬性使用哪個(gè)訪問(wèn)權(quán)限修飾符?易中5為了能夠訪問(wèn)對(duì)封裝的屬性的訪問(wèn)和修改,方法往往用哪個(gè)修飾符修飾?易中5以下哪個(gè)是有關(guān)封裝優(yōu)點(diǎn)的正確描述?易中5以下哪些是關(guān)于完全封裝的正確描述?易中5執(zhí)行下列語(yǔ)句后,變量i的值是:byte i = 127; byte(-27 27-1)i += 1; (當(dāng)溢出時(shí)回到最小)易中5執(zhí)行下列語(yǔ)句后,變量i的值是:byte i = 127;i = i+ 2;易中5char類型的取值范圍是?易中5以下哪個(gè)是10進(jìn)制數(shù)123的正確的十六進(jìn)制表示?易中5以下哪個(gè)是10進(jìn)制數(shù)124的正確的八進(jìn)制表示?易中5下面哪個(gè)賦值語(yǔ)句是合法的?易中5下面哪個(gè)類型是引用類型?易中5下面
8、哪個(gè)不是引用類型?易中5下面哪個(gè)說(shuō)法正確?易中5Double和double分別是什么類型?易中50.3=0.3f的結(jié)果是?易中50.5和0.5f的以下說(shuō)法正確的式?易中5Student s1=new Student(John);Student s2=new Student(Alice);s1=s2;System.out.println(s1.getName();輸出結(jié)果為?易中5public class TestChange /* * * param str */ public static void changeStr(String str) str=“;public static void
9、 main(String args) String str=welcome; changeStr(str); System.out.println(str);運(yùn)行結(jié)果是?易中5public class TestEquals /* * param args */public static void main(String args) String a=a;String b=b;String c=a+b;String d=a+b;System.out.println(a=a);System.out.println(c=ab);System.out.println(d=c);System.out.p
10、rintln(new String(a)+b=c);運(yùn)行結(jié)果是?易中5以下程序運(yùn)行的結(jié)果是:public class Example public static void main(String args) System.out.println(String.replace(g,G) = String.replace(g,G); System.out.println(String.replace(t,t) = String.replace(t,t); 易中5public class TestReplace public static void stringReplace(Stringtext)
11、 text=text.replace(j, i);public static voidbufferReplace(StringBuffer text) text=text.append(C);public static void main(String args)String textString=new String(java);StringBuffer bufferString=newStringBuffer(java);stringReplace(textString);bufferReplace(bufferString);System.out.println(textString+b
12、ufferString);運(yùn)行結(jié)果是?易中5下面哪個(gè)是包裝器類型?易中5Java語(yǔ)言中有多少個(gè)包裝器類型?易中5下列代碼在JDK1.5以上版本執(zhí)行的結(jié)果是?public class Example public static void main(String args) Integer i = 10; Integer j = 10; System.out.println(i = j); i = 210; j = 210; System.out.println(i = j); (超過(guò)-128127為false) 難中5數(shù)組是什么類型?易中5數(shù)組中可以存什么類型的數(shù)據(jù)?易中5下面哪條語(yǔ)句不正確?易
13、中5下面哪條語(yǔ)句不正確?易中5存在Employee類,如何創(chuàng)建一個(gè)長(zhǎng)度為3的Employee類型數(shù)組?易中5以下那種初始化數(shù)組的方式是錯(cuò)誤的?易中5以下哪些是聲明一個(gè)字符串?dāng)?shù)組的正確形式?易中5以下哪些語(yǔ)句正確?易中5以下哪些是初始化數(shù)組的正確形式?易中5執(zhí)行下列代碼后,哪個(gè)結(jié)論是正確的 String s=newString10;易中5數(shù)組索引從幾開始?易中5假設(shè)存在數(shù)組a,如何獲得a的長(zhǎng)度?易中5假設(shè)存在int型數(shù)組a,哪項(xiàng)是正確的增強(qiáng)for循環(huán)迭代該數(shù)組?易中5以下給出代碼運(yùn)行后的結(jié)果是?public class Example public static void main(String
14、 args) int refToArray = 10, 11 ; int var = 1; refToArrayvar - 1 = var = 2; System.out.println(refToArray0 + +refToArray1); 中中5以下代碼運(yùn)行輸出的結(jié)果是什么?public class Example public static void main(String args) char c = new char100; System.out.println(c50); 中中5以下哪個(gè)語(yǔ)句用于獲取數(shù)組中的元素個(gè)數(shù)?中中5下列代碼的執(zhí)行結(jié)果是什么?public class Exa
15、mple public static void main(String args) int index = 1; int foo = new int3; int bar = fooindex; int baz = bar + index; System.out.println(baz); 中中5給出下面代碼:public class Examplestatic int arr = new int10;public static void main(String a)System.out.println(arr1);那個(gè)語(yǔ)句是正確的?中中5以下代碼執(zhí)行的結(jié)果是:public class Exam
16、ple public static void main(String args) int x = 1, 2, 3 ; x1 = (x1 1) ? x2 : 0; System.out.println(x1); 中中5下面哪個(gè)是正確的二維數(shù)組聲明?易中5下面哪個(gè)選項(xiàng)正確?易中5以下哪個(gè)語(yǔ)句實(shí)現(xiàn)了聲明一個(gè)二維整數(shù)數(shù)組?易中5以下代碼的執(zhí)行結(jié)果是?public class Example public static void main(String args) Element a1 = new Element1; Element a2 = new Element21; Element a3 = ne
17、w Element333; System.out.print(a3222); a10 = new Element(); a20 = a21 = a1; a30 = a31 = a32 = a2; System.out.print(a3222); class Element 易中5以下哪些是聲明一個(gè)數(shù)組的正確形式?易中5數(shù)組拷貝方法在哪個(gè)類中?易中5為將數(shù)組myArray的長(zhǎng)度由3改為6,現(xiàn)采取以下代碼:int myArray = new int3;myArray = new int6;代碼執(zhí)行后,以下敘述哪項(xiàng)是正確的?易中5public class TestPass String str =
18、new String(hello);char ch = a,b,c;public static void main(String args) TestPass ex = new TestPass();ex.change(ex.str,ex.ch);System.out.print(ex.str + and );System.out.print(ex.ch);private void change(String str,char ch) str = test ok; ch1 = g;程序運(yùn)行結(jié)果?易中5表達(dá)式(short)10/10.2*2運(yùn)算后結(jié)果是什么類型?易中5一下代碼運(yùn)行輸出結(jié)果是?pu
19、blic class Example public static void main(String args) System.out.println(3.0/0); 易中5下面的代碼段中,執(zhí)行之后i 和j 的值是什么?int i = 1;int j;j = i+;易中5以下代碼的執(zhí)行結(jié)果是:public class Example public static void main(String args) byte x = -64; byte y = -6; System.out.println(x / y + + x % y); 有int變量i的值為16384,133的結(jié)果為?易中5如果有in
20、t變量i和j,i的值為0 xFFFFFFF1,j=I,則j的值為?易中5以下給出代碼運(yùn)行后的結(jié)果是?public class Example public static void main(String args) int x=1; int y=x+1; System.out.println(x+ +y); 易中5下列代碼執(zhí)行結(jié)果是?public class Example public static void main(String args) String str = 123; String str1 = new String(123); String str2 = 123; System
21、.out.println(str = str1); System.out.println(str = str2); 易中5給出以下代碼,假設(shè)arr數(shù)組中只包含正整數(shù)值,請(qǐng)問(wèn)下列代碼段實(shí)現(xiàn)了什么功能?public int guessWhat(int arr) int x = 0; for (int i = 0; i arr.length; i+) x = x arri ? arri : x; return x; 易中5下列給出代碼的運(yùn)行結(jié)果是?public class Example public static void main(String args) int m = 2; int p =
22、1; int i = 0; for (; p m) m = p + i; System.out.println(i equals + i); 易中5下面的表達(dá)式哪個(gè)是正確的?易中5以下哪些賦值表達(dá)式合法?(變量S為一個(gè)字符串)易中5以下代碼執(zhí)行后,x的值為public class Example public static void main(String args) int x = 0; boolean b1, b2, b3, b4; b1 = b2 = b3 = b4 = true; x = (b1 | b2 & b3 b4) ? x+ : -x; System.out.println(x
23、); 0中5現(xiàn)有3個(gè)變量boolean a,boolean b,int c,請(qǐng)問(wèn)以下哪些表達(dá)式合法易中5如果有String s=null,以下代碼哪些選項(xiàng)會(huì)產(chǎn)生異常?易中5下列說(shuō)法正確的是?易中.對(duì)于switch/case語(yǔ)句以下說(shuō)法正確的有易中.下列說(shuō)法正確的是?易中.以下代碼錯(cuò)誤在何處?public class Example public static void main(String args) for(int i=0;j=0,i10;+i,j+=i) j+=i*i+j*j; 易中.類(外部類)可以使用哪個(gè)訪問(wèn)權(quán)限修飾符?易中.以下哪個(gè)約束符可用于定義成員常量易中.給出如下代碼:cla
24、ss Testprivate int m;public static void fun() / some code.如何使成員變量m 被函數(shù)fun()直接訪問(wèn)?易中.以下代碼的執(zhí)行結(jié)果是:public class Example static int i = 1, j = 2; static display(i); i = i + j; static void display(int n) System.out.println(n); public static void main(String args) display(i); 易中.以下代碼的執(zhí)行結(jié)果是:public class Exam
25、ple String s = Outer; public static void main(String args) S2 s2 = new S2(); s2.display(); class S1 String s = S1; void display() System.out.println(s); class S2 extends S1 String s = S2;易中5關(guān)于構(gòu)造器說(shuō)法錯(cuò)誤的是?易中0以下哪個(gè)針對(duì)默認(rèn)無(wú)參構(gòu)造器描述是正確的?易中5當(dāng)一個(gè)類的所有構(gòu)造器均為私有的,以下哪個(gè)描述是正確的?易中5以下哪些修飾符可以用于構(gòu)造器?易中5下列給出的代碼段運(yùn)行結(jié)果是?public cla
26、ss Example int maxElements; void Example() maxElements = 100; System.out.println(maxElements); public Example(int i) maxElements = i; System.out.println(maxElements); public static void main(String args) Example a=new Example(); Example b=new Example(999); 易中511) 已知如下代碼: 1: class Example2: String st
27、r;3: public Example()4: str= example;5: 6: public Example(String s)7: str=s;8: 9: 10: class Demo extends Example11: 12: public class Test13:public void f () 14:Example ex = new Example(Good);15:Demo d = new Demo(Good);16: 哪句語(yǔ)句會(huì)導(dǎo)致錯(cuò)誤?易中5以下哪些關(guān)于構(gòu)造器的描述是正確的?易中5下列說(shuō)法正確的是?易中5下列說(shuō)法錯(cuò)誤的是?易中5給出下面的代碼段:public class
28、 Baseint w, x, y ,z;public Base(int a,int b)x=a; y=b;public Base(int a, int b, int c, int d)/ assignment x=a, y=bw=d;z=c;在代碼說(shuō)明/ assignment x=a, y=b處寫入如下哪幾個(gè)代碼是正確的?( )易中5下列說(shuō)法錯(cuò)誤的是?易中5在下面代碼中,在插入代碼處插入什么語(yǔ)句可以實(shí)現(xiàn)在A中的amethod()方法中直接調(diào)用類C的test()方法,而不需要?jiǎng)?chuàng)建一個(gè)類C的實(shí)例?class C public void test() System.out.println(C); c
29、lass B extends C public void test() System.out.println(B); class A extends B public void test() System.out.println(A); public void amethod() /插入代碼處 易中5關(guān)于重載和覆蓋,以下說(shuō)法錯(cuò)誤的是?易中5現(xiàn)有基類中的一個(gè)方法:void method(),請(qǐng)問(wèn)以下哪些是子類中覆蓋該方法的正確形式?易中5現(xiàn)有如下代碼:class Super public float getNum() return 3.0f; class Sub extends Super /
30、空白處請(qǐng)問(wèn)以下哪個(gè)語(yǔ)句放置在注釋的空白處會(huì)引起編譯錯(cuò)誤?易中5以下關(guān)于方法覆蓋描述正確的有()易中5現(xiàn)有一下代碼:protected void method(intx).,以下哪些有關(guān)覆蓋該方法的描述是正確的?易中5以下代碼的執(zhí)行結(jié)果是什么?public class Example int i = 100; public void print() System.out.println(50); public static void main(String args) Example a = new A(); System.out.println(a.i); a.print(); class A
31、 extends Example int i = 200; public void print() System.out.println(300); 易中5現(xiàn)有以下代碼:class Base class Sub extends Base public String getFields() String name = Sub; return name; class DoSub public static void main(String args) Base b = new Sub(); / 插入語(yǔ)句處 在插入語(yǔ)句處插入那條代碼能夠輸出Sub?易中5當(dāng)線程在IO處堵塞時(shí),以下哪些描述正確?易中5
32、以下哪些描述是正確的?易中5線程的默認(rèn)優(yōu)先級(jí)是哪項(xiàng)?易中5以下代碼的執(zhí)行結(jié)果是什么?public class Example public static void main(String args) Base b = new Base(); Subclass1 S1 = new Subclass1(); Subclass2 s2 = new Subclass2(); s1 = (Subclass1) s2; class Base class Subclass1 extends Base class Subclass2 extends Base 易中5請(qǐng)問(wèn)以下哪個(gè)描述是正確的?易中5請(qǐng)問(wèn)wait
33、()方法定義在以下哪個(gè)類上?易中5請(qǐng)問(wèn)wait()方法在以下哪個(gè)代碼中被調(diào)用?易中5請(qǐng)問(wèn)以下哪些描述是正確的?易中5以下那些是線程停止執(zhí)行的原因?易中5以下哪些方法可以用于將一個(gè)正在執(zhí)行的線程停止執(zhí)行?易中5當(dāng)一個(gè)處于阻塞狀態(tài)的線程解除阻塞后,它將回到那個(gè)狀態(tài)?易中5請(qǐng)問(wèn)以下哪些是有關(guān)線程狀態(tài)轉(zhuǎn)換的正確描述?易中5以下關(guān)于abstract的說(shuō)法,正確的是?易中5下列說(shuō)法錯(cuò)誤的是?易中5定義在Object類上的hashCode()方法的返回值類型是什么?易中5關(guān)于集合中對(duì)象的equals()和hashCode()規(guī)定說(shuō)法錯(cuò)誤的是?易中5以下代碼執(zhí)行結(jié)果是什么?class Person stati
34、c void sayHello() System.out.println(HelloWorld!); public class Example public static void main(String args) (Person) null).sayHello(); 易中5以下代碼的執(zhí)行結(jié)果是?class RectObject public int x; public int y; public RectObject(int x, int y) this.x = x; this.y = y; Override public boolean equals(Object obj) if (th
35、is = obj) return true; if (obj = null) return false; if (getClass() != obj.getClass() return false; final RectObject other = (RectObject) obj; if (x != other.x) return false; if (y != other.y) return false; return true; public class Example public static void main(String args) HashSet set = newHashS
36、et(); RectObject r1 = new RectObject(3, 3); RectObject r2 = new RectObject(5, 5); RectObject r3 = new RectObject(3, 3); set.add(r1); set.add(r2); set.add(r3); set.add(r1); System.out.println(size: + set.size(); 易中5以下代碼執(zhí)行結(jié)果是?class RectObject public int x; public int y; public RectObject(int x, int y)
37、 this.x = x; this.y = y; Override public int hashCode() / TODO Auto-generated method stub return (int)System.nanoTime(); Override public boolean equals(Object obj) return false; public class Example public static void main(Stringargs) HashSet set = newHashSet(); RectObject r1 = new RectObject(3,3);
38、RectObject r2 = new RectObject(5,5); RectObject r3 = new RectObject(3,3); set.add(r1); set.add(r2); set.add(r3); set.add(r1); System.out.println(size: +set.size(); 給出下面代碼,請(qǐng)問(wèn)該程序的運(yùn)行結(jié)果是什么?interface A int x=0; A() x=5; A(int s) x=s; 易中5關(guān)于接口的說(shuō)法,正確的是()易中5請(qǐng)選擇所有的正確答案。易中5以下哪些描述是正確的?易中5給出以下代碼,請(qǐng)問(wèn)以下哪個(gè)描述是正確的?Pub
39、licXXXX extends something1,something2易中5關(guān)于類繼承的說(shuō)法,正確的是()易中5Java語(yǔ)言中異常的分類是哪項(xiàng)?易中5所有異常的父類是哪項(xiàng)?易中5以下關(guān)于Error和Exception類的描述正確的是?易中5以下有關(guān)java.lang.Exception異常類的正確描述有?易中5對(duì)以下兩個(gè)代碼片段說(shuō)法正確的是?代碼片段1: int a = 3; int b = 0; int c = a / b;代碼片段2:float a = 3.0f; /Infinity(無(wú)窮大)float b = 0.0f;float c = a / b;易中5下列代碼執(zhí)行后的結(jié)果是?p
40、ublic class Example public static void main(String args) try double x = 64.0; double y = 0.0; System.out.println(x % y); catch (Exception e) System.out.println(Exception); 易中5下列代碼執(zhí)行后的結(jié)果是?public class Example public static void main(String args) try double x = 64.0; double y = 0.0; System.out.println
41、(x % y = x % y); catch (Exception e) System.out.println(Exception); 易中5下列代碼執(zhí)行后的結(jié)果是?public class Example public static void main(String args) try System.out.println(Float.NaN =Float.NaN);System.out.println(Float.POSITIVE_INFINITY=Float.POSITIVE_INFINITY); catch (Exception e) System.out.println(Except
42、ion); 易中5下列屬于非受檢異常(運(yùn)行時(shí)異常)的是哪項(xiàng)?易中5以下說(shuō)法錯(cuò)誤的是?易中5請(qǐng)問(wèn)以下哪個(gè)程序代碼體現(xiàn)了對(duì)象之間的is a關(guān)系?易中5給出以下代碼,改程序的執(zhí)行結(jié)果是?interface Base int k = 0;public class Example implements Base public static void main(String args) int i; Example exm = new Example(); i = exm.k; i = Example.k; i = Base.k; System.out.println(i); 易中5現(xiàn)有以下代碼:inte
43、rface W class Z implements W class X extends Z class Y extends Z 下列哪些代碼段是正確的?中5Java語(yǔ)言中異常的分類是哪項(xiàng)?易中5現(xiàn)有代碼:public class Example public static void main(String args) try System.out.print(Integer.parseInt(forty); catch (RuntimeException e) System.out.println(Runtime); catch (NumberFormatException e) Syste
44、m.out.println(Number); 執(zhí)行結(jié)果是什么?易中5對(duì)以下兩個(gè)代碼片段說(shuō)法正確的是?代碼片段1: int a = 3; int b = 0; int c = a / b;代碼片段2:float a = 3.0f;float b = 0.0f;float c = a / b;易中5下列代碼執(zhí)行后的結(jié)果是?public class Example public static void main(String args) try double x = 64.0; double y = 0.0; System.out.println(x % y); catch (Exception e
45、) System.out.println(Exception); 易中5現(xiàn)有如下代碼:public class Example extends Utils public static void main(String args) try System.out.println(newExample().getInt(42); catch (NumberFormatException e) System.out.println(NFExc); int getInt(String arg) throwsNumberFormatException return Integer.parseInt(arg
46、); class Utils int getInt(String arg) return 42; 該代碼執(zhí)行的結(jié)果是?易中5關(guān)于異常處理,說(shuō)法錯(cuò)誤的是?易中5關(guān)于以下代碼,說(shuō)法正確的是?class Example public static void main(String args)throws IOException System.out.println(Before Try); try catch (Throwable e) System.out.println(Inside Catch); System.out.println(At the End); 易中5關(guān)于trycatchfin
47、ally結(jié)構(gòu),描述正確的是些?易中5當(dāng)fragile()方法拋出一個(gè)IllegalArgumentException異常時(shí),下列代碼的運(yùn)行結(jié)果是什么?public static void main(String args)throws IOException try fragile(); catch (NullPointerException e) System.out.println(NullPointerExceptionthrown); catch (Exception e) System.out.println(Exception thrown); finally System.out
48、.println(Done withexceptions); System.out.println(myMethod is done); 易中5現(xiàn)有如下代碼:public class Example public static void main(String args) try int x=Integer.parseInt(42a); /插入代碼處 System.out.println(oops); 在插入代碼處插入哪些語(yǔ)句可以在運(yùn)行后輸出oops?易中5下列代碼的執(zhí)行結(jié)果是?class Example public static void main(String args)throws I
49、OException int i = 1, j = 1; try i+; j-; if (i = j) j+; catch (ArithmeticException e) System.out.println(0); catch (ArrayIndexOutOfBoundsException e) System.out.println(1); catch (Exception e) System.out.println(2); finally System.out.println(3); System.out.println(4); 易中5以下哪些是catch語(yǔ)句能夠捕獲處理的異常?易中5以下
50、哪些描述是正確的?易中5請(qǐng)問(wèn)以下代碼的直接執(zhí)行結(jié)果是?class Example public static void main(String args) try System.out.println(args0); System.out.println(Im nomal); if (true) return; catch (Exception ex) System.out.println(Im exception); if (true) return; finally System.out.println(Im finally.); System.out.println(Out of try
51、.); 易中5下列代碼的運(yùn)行結(jié)果是?class Example public static void main(String args)throws IOException try return; finally System.out.println(Finally); 易中5假設(shè)有自定義異常類ServiceException,那么拋出該異常的語(yǔ)句正確的是哪項(xiàng)?易中5在方法聲明中,說(shuō)明該方法可能會(huì)拋出的異常列表時(shí)使用哪個(gè)關(guān)鍵字?易中5現(xiàn)有代碼如下:public class Example void topGo() try middleGo(); catch (Exception e) Syst
52、em.out.println(catch); void middleGo() throws Exception go(); System.out.println(late middle); void go() throws Exception throw new Exception(); public static void main(String args) Example example = new Example(); example.topGo(); 該代碼的執(zhí)行結(jié)果是?易中5如下代碼執(zhí)行后的輸出結(jié)果是?public class Example public static void m
53、ain(String args) try throw new Exception(); catch (Exception e) try throw new Exception(); catch (Exception e2) System.out.println(inner); System.out.println(middle); System.out.println(out); 易中5現(xiàn)有如下代碼:public class Example public static void main(String args) /a new Example().topGo(); void topGo() /
54、 b middleGo(); void middleGo() / c go(); System.out.println(late middle); void go() / d throw new Exception(); 為了使代碼能夠編譯通過(guò),需要在哪個(gè)地方加入聲明throws Exception?易中5下面代碼的執(zhí)行結(jié)果是?class Example extends Utils public static void main(String args) try System.out.print(newExample().getlnt(42); catch (Exception e) Syst
55、em.out.println(Exc); int getlnt(String arg) throws Exception return Integer.parseInt(arg); class Utils int getlnt() return 42; 易中5請(qǐng)問(wèn)以下哪些關(guān)于trycatchfinally結(jié)構(gòu)中的finally語(yǔ)句的描述是正確的?易中5關(guān)于以下代碼,說(shuō)法正確的是?class Example public static void main(String args)throws IOException if (args0 = hello) throw new IOException
56、(); 易中5關(guān)于以下代碼,說(shuō)法正確的是?class Example public static void main(String args)throws IOException System.out.println(Before Try); try catch (java.io.IOException e) System.out.println(Inside Catch); System.out.println(At the End); 易中5給出以下代碼:class Example public static void main(String args)throws IOException
57、 try methodA(); catch (IOException e) System.out.println(caught IOException); catch (Exception e) System.out.println(caught Exception); 如果methodA()方法拋出一個(gè)IOException異常,則該程序的運(yùn)行結(jié)果是什么?易中5給出以下代碼,執(zhí)行結(jié)果是?class Example public static void main(String args)throws IOException aMethod(); static void aMethod() tr
58、y System.out.println(Try); return; catch (Exception e) System.out.println(Catch); finally System.out.println(Finally); 易中5以下代碼中,如果test()方法拋出一個(gè)NullPointException異常時(shí),打印輸出什么內(nèi)容?class Example public static void main(String args)throws IOException try test(); System.out.println(Message1); catch (ArrayInde
59、xOutOfBoundsException e) System.out.println(Message2); finally System.out.println(Message3); 易中5以下代碼執(zhí)行結(jié)果是什么?class Example public static String output = ; public static void foo(int i) try if (i = 1) throw new Exception(); output += 1; catch (Exception e) output += 2; return; finally output += 3; out
60、put += 4; public static void main(String args)throws IOException foo(0); foo(1); System.out.println(output); 易中5以下代碼執(zhí)行結(jié)果是?public abstract class Example extendsBase public abstract void method();class Base public Base() throws IOException throw new IOException(); 易中5關(guān)于以下代碼正確的說(shuō)法是:1.public class Exampl
溫馨提示
- 1. 本站所有資源如無(wú)特殊說(shuō)明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒(méi)有圖紙預(yù)覽就沒(méi)有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫(kù)網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。
最新文檔
- 高中數(shù)學(xué)分層練習(xí)(壓軸題)06:函數(shù)與導(dǎo)數(shù)(30題)【含解析】
- 水池專項(xiàng)施工方案
- 洗手洗腳池施工方案
- 電梯施工方案模板
- 基于涉入理論的高爾夫球手地方依戀研究
- 6到12歲的感統(tǒng)訓(xùn)書籍
- consider的固定搭配和例句總結(jié)
- 2025年往年英語(yǔ)a b級(jí)試題及答案
- 燈火闌珊處高情商回復(fù)
- 4-氨基-丁酸叔丁酯醋酸鹽
- 日常采購(gòu)維修合同范本
- 2024-2025年第二學(xué)期一年級(jí)語(yǔ)文教學(xué)進(jìn)度表
- 企業(yè)員工職務(wù)犯罪預(yù)防
- 2025年貴州省高職單招醫(yī)學(xué)類職業(yè)技能測(cè)試題庫(kù)及答案(備考刷題)
- (2025春新教材)部編版七年級(jí)語(yǔ)文下冊(cè)全冊(cè)教案
- 5《水污染》教學(xué)設(shè)計(jì)-2023-2024學(xué)年科學(xué)六年級(jí)下冊(cè)冀人版
- 2025年安徽電氣工程職業(yè)技術(shù)學(xué)院高職單招職業(yè)技能測(cè)試近5年??及鎱⒖碱}庫(kù)含答案解析
- 統(tǒng)編版歷史 選擇性必修二第12課 《水陸交通的變遷》課件(共27張)
- 幼兒園開學(xué)教職工安全教育培訓(xùn)
- 2025-2030年中國(guó)發(fā)酵豆粕行業(yè)運(yùn)行態(tài)勢(shì)及投資前景規(guī)劃研究報(bào)告
- 小學(xué)生雙擁活動(dòng)國(guó)防教育
評(píng)論
0/150
提交評(píng)論