【正文】
] array。 106. 下面哪條語句定義了5個元素的數(shù)組( B )A、int [] a={22,23,24,25,12}。 C、float f3=0x12345 。105. 下面哪條語句不能定義一個float型的變量( C )A、float f1= 343 。 C、String s3=(String) ‘a(chǎn)bc’ 。102. 下面哪個修飾符修飾的方法只能被本類中的其他方法使用( C )A、protected B、static C、private D、public103. 下面哪個運(yùn)算后結(jié)果為32 ( D )A、2^5 B、(82)4 C、25 D、 (21)*(323)104. 下面哪個是對字符串String的正確定義 ( A )A、String s1=null。C、char c4=0xbeef 。 } } A、 in the Inner outer B、 outer C、 in the InnerD、 編譯不通過99. 下面哪個單詞是Java語言的關(guān)鍵字( C )A、Float B、this C、string D、unsigned 100. 下面哪個是Java語言中正確的標(biāo)識符( C )A、3 B、import C、that D、this101. 下面哪個語句不能定義一個字符變量( D )A、char c1=06477。 (123,123)。 class Inner{ void methodInner(){ (in the Inner)。 void foo(double d,final float f){ String s。 case 2: (two)。 break。 switch (i) { default: (default)。 ()。 , 會產(chǎn)生什么結(jié)果 ( A ) public class X extends Thread implements Runable{ public void run(){ (this is run())。 D、 c=false。 C、 c=true。 B、 c=true。 這段程序執(zhí)行完后,c與result的值是: ( A )A、 c=false。amp。amp。 boolean b=true。 D、 以上說法無一正確。 B、 創(chuàng)建線程的兩種方法中,從Thread類中繼承的創(chuàng)建方式可以防止出現(xiàn)多父類問題。 ()。 Aclass a1=new Bclass()。 } } public class Bclass extends Aclass{ void go{ (Bclass)。若Button1的功能是:點(diǎn)擊后彈出一個用于輸入的界面,獲取用戶想要顯示的圖像文件名,則該界面最好是(從編程簡單和程序不易出錯的角度考慮): A、 模式(Modal)Dialog B、 非模式(Nonemodal)Dialog C、 FileDialog D、 Frame 91. 界面如上題所示。 7} } 8) else { (end)。 4} } 5) else if ((str != null) amp。amp。 ? ( B )A、 public main(String args[]) B、 public static void main(String args[]) C、 private static void main(String args[]) D、 void main() : 1) String str = null。 public static void main(String args[]) { (arr[10])。 return s。 11} } 第10行語句將調(diào)用哪行語句? ( B )A、 line 2 B、 line 3 C、 line 6 D、 line 7? ( C )A、 transient B、 finally C、 throw D、 static ()方法的返回類型是: ( B )A、 int B、 void C、 boolean D、 static ? ( C )A、 B、 C、 D、 : public class Parent { public int addValue( int a, int b) { int s。 11} } 12} } 哪行將引起一個編譯時錯誤?( C ) A、 line 3 B、 line 5 C、 line 6 D、 line 10 : 1) class Person { 2} public void printValue(int i, int j) {//... } 3} public void printValue(int i){//... } 4} } 5) public class Teacher extends Person { 6} public void printValue() {//... } 7} public void printValue(int i) {//...} 8} public static void main(String args[]){ 9} Person t = new Teacher()。 9} t1=new Test()。 8} j=0。 } 5} public static void main(String arg[]) { 6} Test t1,t2。 1) public class Test { 2} int m, n。 //p, t and s are all nonnull. if(t instanceof Person) { s = (Student)t。 Teacher t。 } 9} public static void main(String arg[]) { 10} Parent p = new Parent()。 3} public Parent(){} 4} } 5) public class Child extends Parent { 6} private String department。 C、 final public int MAX_LENGTH=100。 ( B )A、 public int MAX_LENGTH=100。 8) I。 6) ( The value of j is + j )。 3) I = 100。 } } 那個語句是正確的? ( C )A、 編譯時將產(chǎn)生錯誤; B、 編譯時正確,運(yùn)行時將產(chǎn)生錯誤; C 、輸出零; D、 輸出空。 ,哪種布局管理器的容器中的組件大小不隨容器大小的變化而改變? ( A )A、 CardLayout B、 FlowLayout C、 BorderLayout D、 GridLayout : public class Person{ static int arr[] = new int[10]。 (9)。 int c=()。 int c=()。 B、 FileInputStream in=new FileInputStream()。 (9)。 ()。 } } A、 good and abc B、 good and gbc C、test ok and abc D、 test ok and gbc , 會產(chǎn)生什么結(jié)果 ( C )public class X extends Thread implements Runable{ public void run(){ (this is run())。 ch[0]=39。 ()。 (,)。}。,39。,39。 char[]ch={39。 D、 double=。 B、 Boolean=null。(Vector)對象中每個元素可以是不同類型的對象。(Vector)對象存放的是一組有序的對象。D、一個java文件中可以有多個class定義。B、構(gòu)造函數(shù)是類中的特殊方法。 D、 double=。 B、 Boolean=null。5下面方法中的“返回類型Type”應(yīng)該是什么? ( A )public class ReturnIt{ returnType methodA(byte x, double y){ return (short)x / y * 2。C: int[] x = {1,2,3}。50、下面哪個語句(初始化數(shù)組)是不正確的:( B )A: int x[] = {1,2,3}。C: char c = 17c。}}A、 編譯出錯B、 nullC、 1D、 04下面哪條語句是正確的?( B )A: short snum = 99s。MyClass(){i =0。(“y is ”+ )。Point p=()。(300,300)。D、 int z=015。B、 String name=’Excellent’。 interface B { void print()。 abstract interface B extends A1,A2 //AA2為已定義的接口{ abstract void print(){ }。 abstract interface B{ void print() 。 interface B{ void print() { } 。B、第2行能通過編譯,但第3行編譯出錯C、第3行能通過編譯,但第3行運(yùn)行時出錯D、第1行、第2行和第3行的聲明都是正確的問以下哪個說法是正確的?3. A A a0=new A()。 D、()3A派生出子類B void method1() { } static void method2() { }}A、();B、()。3假設(shè)A類有如下定義,設(shè)a是A類的一個實(shí)例,下列語句調(diào)用哪個是錯誤的?( B )class A{ int i。C、import .* 。A、import .* 。 C、()。 static String s。3下列類的定義中,錯誤的是( B )。C.子類必須通過super關(guān)鍵字調(diào)用父類的構(gòu)造函數(shù)。A.創(chuàng)建子類的對象時, 先調(diào)用子類自己的構(gòu)造函數(shù),然后調(diào)用父類的構(gòu)造函數(shù)。 (count[4])。 A. 類是對象的抽象 B. 類是對象的具體實(shí)例 C. 對象是類的抽象 D. 對象是類的子類3下列關(guān)于修飾符混用的說法,錯誤的是( B ) A. abstract不能與final并列修飾同一個類 B. abstract類中不可以有private的成員 C. abstract方法必須在abstract類中 D. static方法中能處理非static的屬性3編譯并運(yùn)行下述程序段的結(jié)果是:( A )。 B.行4執(zhí)行,行6不執(zhí)行C.行6執(zhí)行,行4不執(zhí)行 A.行4與行6都將執(zhí)行 is succeeded”)。 (“= = if(s1==s2)4.String(s1);3.s2=newString2.A)最大的 B)最小的 C)任意的 D)頭上的關(guān)于以下程序段,正確的說法是( C )。}}A.正常輸出Hello JavaB.編譯時出錯C.運(yùn)行時出錯D. 以上答案都不對2選擇排序的思想是,將數(shù)據(jù)序列劃分為兩個子列,一個子列是排好序的,另一個是尚未排序的。2運(yùn)行下面程序段的結(jié)果是:( B )。C.?dāng)?shù)組沒有l(wèi)ength()這個方法,string有l(wèi)ength()這個方法。2關(guān)于length()這個方法的表述正確的是哪個? ( C )A.?dāng)?shù)組有l(wèi)ength()這個方法,string也有l(wèi)ength()這個方法。 D. C. B.int aMethod aMethod ( ){...}D、public aMethod(){...}C、public){...}B、public aMethod(){...}的重載函數(shù)?( D )A、void } } A 0 B 7 c 編譯有錯誤 D 其他答案2下面哪個函數(shù)是publici=100。2下面程序運(yùn)行結(jié)果為:( D ?。﹑ublic class test3{public static void main(String args[]) { int cou