【正文】
abstract void method( )14編譯Java Application 源程序文件將產(chǎn)生相應的字節(jié)碼文件,這些字節(jié)碼文件的擴展名為( B )。 A. .java B. .class C. .html D. .exe14如果類中的成員變量可以被同一包訪問,則使用如下哪個約束符?D A、 private B、public C、protected D、no modifier14以下哪個方法用于定義線程的執(zhí)行體? C A、 start() B、init() C、run() D、main(), 變量值保持為常量100,用簡短語句定義這個變量。 ( B )A、 public int MAX_LENGTH=100。 B、 final int MAX_LENGTH=100。 C、 final public int MAX_LENGTH=100。 D、 public final int MAX_LENGTH=100. : 1) class Parent { 2} private String name。 3} public Parent(){} 4} } 5) public class Child extends Parent { 6} private String department。 7} public Child() {} 8} public String getValue(){ return name。 } 9} public static void main(String arg[]) { 10} Parent p = new Parent()。 11} } 12} } 那些行將引起錯誤? ( C )A、 第3行 B、 第6行 C、 第7行 D、 第8行; Person p。 Teacher t。 Student s。 //p, t and s are all nonnull. if(t instanceof Person) { s = (Student)t。 } 最后一句語句的結(jié)果是: A、 將構(gòu)造一個Student對象; B、 表達式是合法的; C、 表達式是錯誤的; D、 編譯時正確,但運行時錯誤。 1) public class Test { 2} int m, n。 3} public Test() {} 4} public Test(int a) { m=a。 } 5} public static void main(String arg[]) { 6} Test t1,t2。 7} int j,k。 8} j=0。 k=0。 9} t1=new Test()。 10} t2=new Test(j,k)。 11} } 12} } 哪行將引起一個編譯時錯誤? ( A )A、 line 3 B、 line 5 C、 line 6 D、 line 10 : ( C ) 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()。 10) (10)。 11) } 第10行語句將調(diào)用哪行語句?? 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 ? ( B )A、 B、 C、 D、 : public class Parent { public int addValue( int a, int b) { int s。 s = a+b。 return s。 } } class Child extends Parent { } 下述哪些方法可以加入類Child? ( D )A、 int addValue( int a, int b ){// do something...} B、 public void addValue (int a, int b ){// do something...} C、 public int addValue( int a ){// do something...} D、 public int addValue( int a, int b )throws MyException {//do something...} : public class test{ static int a[] = new a[10]。 public static void main(String args[]) { (arr[10])。 } } 那個選項是正確的? ( A )A、 編譯時將產(chǎn)生錯誤; B、 編譯時正確,運行時將產(chǎn)生錯誤; C、 輸出零; D、 輸出空。 ? ( B )A、 public main(String args[]) B、 public static void main(String args[]) C、 private static void main(String args[]) D、 void main() ,下列選項中,哪個反映了Java程序并行機制的特點( B ) A 安全性 B 多線程 C 跨平臺 D 可移植 ( D ) A abstract final class H1{…} B abstract private move(){…} C protected private number; D public abstract class Car{…} ( D ) A while循環(huán)能實現(xiàn)的操作,for循環(huán)也都能實現(xiàn) B while循環(huán)判斷條件一般是程序結(jié)果,for循環(huán)判斷條件一般是非程序結(jié)果 C 兩種循環(huán)任何時候都可替換 D 兩種循環(huán)結(jié)構(gòu)中都必須有循環(huán)體,循環(huán)體不能為空 ( A ) A 程序中的語法錯誤 B 程序的編譯錯誤 C 程序執(zhí)行過程中遇到的事先沒有預料到的情況 D 程序事先定義好的可能出現(xiàn)的意外情況 ( B ) A 每次讀入的字節(jié)數(shù)不同 B 前者帶有緩沖,后者沒有 C 前者是塊讀寫,后者是字節(jié)讀寫 D 二者沒有區(qū)別,可以互換使用 ( D ) A 都由Listener完成 B 都由相應事件Listener處登記過的構(gòu)件完成 C 由Listener和構(gòu)件分別完成 D 由Listener和窗口分別完成 ( B ) A 讀取客戶端文件 B 在客戶端主機上創(chuàng)建新文件 C 在客戶端裝載程序庫 D 讀取客戶端部分系統(tǒng)變量 ( B ) A JFrame B JButton C JPnel D JApplet ,應使用下列哪種布局管理器( C ) A BoxLayout B GridLayout C BorderLayout D FlowLayout ,需要使用下列哪種流才合適( A ) A Filter stream B File stream C Random access stream D Piped stream ( B) ,但形參的個數(shù)或類型不同 ,但形參的類型可以不同 ,但形參的個數(shù)或類型相同 ,并且函數(shù)的返回類型相同 (D ) public class Example{ String str=new String(″good″)。 char[]ch={′a′,′b′,′c′}。 public static void main(String args[]){ Example ex=new Example()。 (,ex,ch)。 (+″and″)。 ()。 } public void change(String str,char ch[]){ str=″test ok″。 ch[0]=′g′。 } } and abc and gbc ok and abc ok and gbc ,會產(chǎn)生的結(jié)果是( C ) public class X extends Thread implements Runable{ public void run(){ (″this is run()″)。 } public static void main(String args[]) } Thread t=new Thread(new X())。 ()。 } } ,下列哪種是正確的( B ) ,子類在后 ,父類在后 ,其他如何排列都無關 ,數(shù)值類型值中可能出現(xiàn)的符號是( A ) ( C ) (B ) s=″你好″。int i=3。s+=i。 s=″你好″。int i=3。if(i==s){s+=i}。 s=″你好″。int i=3。s=i+s。 s=″你好″;int i=3。s=i+。 ( D ) ,如釋放資源、關閉文件、關閉數(shù)據(jù)庫等由(C )來完成。 ″″文件中讀出第10個字節(jié)到變量C中,下列哪個方法適合(A ) in=new FileInputStream(″″)。.。int c=()。 in=new FileInputStream(″″)。.。int c=()。 in=new FileInputStream(″″)。int c=()。 in=RandomAccssFile(″″)。.。int c=()。 ,那么應使用哪個限定詞(D ) ( C) abstract class MineBase{ abstract void amethod()。 static int i。 } public class Mine extends MineBase { public static void main(String argv[]){ int[] ar=new int[5]。 for(i=0。i (ar[i])。 } } ,數(shù)組ar[]必須初始化 ,Mine應聲明為abstract (B ) *10 +10 b=011。(b)。輸出結(jié)果為(D ) ,不屬于整數(shù)類型變量的是( A) ( B) (A ) o=new Button(″A″)?! ?b=new Object(″B″)。 p=new Frame()?! ? f=new Panel()。 ,下列哪個特點不屬于JVM執(zhí)行特點(C ) (D ) ,下列哪種說法是正確的( B) ,( A) (C ) ,在命令行下用( C)鍵可以終止程序的運行。 +C +S ,下列標識符錯誤的是(A ) B.—name C.amp。count D.—j ,以下不屬于復合類