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

正文內(nèi)容

java語(yǔ)言程序設(shè)計(jì)期末考試試題及答案-免費(fèi)閱讀

  

【正文】 7. 在一個(gè)時(shí)間只能由一個(gè)線程訪問(wèn)的資源稱為 ( ) 。 }while(friend!=null)。 =chinese。 } } class Student { protected String name。 new Student(Jack, 39。 while(true) { String str = ()。 String s1 = new String(abcde)。一個(gè)進(jìn)程在其執(zhí)行過(guò)程中,可以產(chǎn)生多個(gè)線程——多線程,形成多條執(zhí)行線索。C)b[1][1]的值是5。二、多選題下面哪些關(guān)鍵字能用來(lái)控制對(duì)類成員的訪問(wèn)( )?A) public B) protected C) private D) default 下面關(guān)于Java中異常處理try塊的說(shuō)法正確的是( )?A) try塊后通常應(yīng)有一個(gè)catch 塊,用來(lái)處理try塊中拋出的異常。 FileOutputStream file=new FileOutputStream(, true)。A) Throwable 類是 Java 語(yǔ)言中Error類和Exception類的父類。}(min)。 j++) { sum+=b[i][j]。 (x+y+z)。 int n = ()。 int x=(str)。 Iterator it=()。import .*。 (new JButton(d))。 import .*。D)對(duì)于單處理器系統(tǒng),多個(gè)線程分時(shí)間片獲取CPU或其他系統(tǒng)資源來(lái)運(yùn)行。 B) catch 塊后必須有finally塊。C) RandomAccessFile既可以用來(lái)讀文件,也可以用來(lái)寫文件。A)新建 B)運(yùn)行 C)就緒 D)死亡 下面說(shuō)法正確的是( )。import .*。 Test t=new Test()。int max=x[0]。 for(int i=0。 Integer integ =new Integer(9); boolean b = integ instanceof Object。 應(yīng)用程序的main方法中有以下語(yǔ)句,則輸出的結(jié)果是 ( )。 (a,abcde)。 String s2=new String(abc)。} A) aceg B) ACEG C) abcdefg D) abcd 有整型數(shù)組:int[] x={12,35,8,7,2}。 private class MenuHandler implements ActionListener { public void actionPerformed(ActionEvent e) { if (() == miClose_Clicked) { (0)。 (miCopy)。 (null)。 miSave = new MenuItem(保存)。 // 保存菜單項(xiàng) MenuItem miClose。import 。解答:import 。 }}按以下要求編寫程序(1) 編寫Animal接口,接口中聲明run() 方法(2) 定義Bird類和Fish類實(shí)現(xiàn)Animal接口(3) 編寫B(tài)ird類和Fish類的測(cè)試程序,并調(diào)用其中的run()方法解答:public interface Animal { void run()。五、程序設(shè)計(jì)題按以下要求編寫程序(1) 創(chuàng)建一個(gè)Rectangle類,添加width和height兩個(gè)成員變量(2) 在Rectangle中添加兩種方法分別計(jì)算矩形的周長(zhǎng)和面積(3) 編程利用Rectangle輸出一個(gè)矩形的周長(zhǎng)和面積解答:public class Rectangle { float width, height。Throw語(yǔ)句就是來(lái)明確地拋出一個(gè)異常;首先你必需得到一個(gè)Throwable的實(shí)例句柄,通過(guò)參數(shù)傳到catch中,或者采用new操作符來(lái)創(chuàng)建一個(gè)。 ()。 = 66123456。 }}class Son extends Father { String school。public class Father { String name, address, tel。 private static String name。 cName = name。 = age。1下面程序段的執(zhí)行結(jié)果是( ) int a[] = { 2, 3, 4, 5, 6 }。異常處理是由( )、( )和finally塊三個(gè)關(guān)鍵所組成的程序塊。Java中布爾類型的常量有兩種,它們是( )和( )。C、import .*。 C、(b,South)。 D、String t = s + “abc”。 }}4.閱讀以下程序,寫出輸出結(jié)果。 String s。 } for ( i =0 。 i 。class StringTest1{ public static void main(String[] args) { String s1=hello。A、private B、protected C、private protected D、public1有以下方法的定義,請(qǐng)選擇該方法的返回類型( )。 D、a和b都是整數(shù)類型變量并且值相等。( )1.2 .public class Interesting{3. //do sth 4.}A、import .*。 ( )9.在Java中對(duì)象可以賦值,只要使用賦值號(hào)(等號(hào))即可,相當(dāng)于生成了一個(gè)各屬性與賦值對(duì)象相同的新對(duì)象。 } }《JAVA語(yǔ)言程序設(shè)計(jì)》期末考試試題及答案2(應(yīng)考必備題庫(kù))一.判斷題1.Java的源代碼中定義幾個(gè)類。 public class abc { public static void main(String args[ ]) { (a=+a+\nb=+b)。}} import .* 。三、寫出下面程序的運(yùn)行結(jié)果 import .*。設(shè)有數(shù)組定義:int MyIntArray[ ] = { 10 , 20 , 30 , 40 , 50 , 60 , 70}。 A. public B. private C. static D. protected為AB類的一個(gè)無(wú)形式參數(shù)無(wú)返回值的方法method書寫方法頭,使得使用類名AB作為前綴就可以調(diào)用它,該方法頭的形式為( )。 A. static void method( ) B. public void method( ) C. final void method( ) D. abstract void method( )二、填空題開發(fā)與運(yùn)行Java程序需要經(jīng)過(guò)的三個(gè)主要步驟為 、 和 。 則執(zhí)行以下幾個(gè)語(yǔ)句后的輸出結(jié)果是 。public class abc{ public static void main(String args [ ]){ AB s = new AB(Hello!,I love JAVA.)。 public class abc { public static void main(String args[ ]) { int i, s = 0 。 } } class SubClass extends SuperClass { int c。( ) 2.Java程序里,創(chuàng)建新的類對(duì)象用關(guān)鍵字new,回收無(wú)用的類對(duì)象使用關(guān)鍵字free。 ( )二.單項(xiàng)選擇題1.Java application中的主類需包含main方法,以下哪項(xiàng)是main方法的正確形參?( )A、 String args B、String ar[] C、Char arg D、StringBuffer args[]2.以下關(guān)于繼承的敘述正確的是( )。 B、package mypackage。14.FilterOutputStream是BufferedOutputStream、DataOutputStream及PrintStream的父類,以下哪個(gè)類可能是FilterOutputStream構(gòu)造函數(shù)的參數(shù)類型?A、OutputStream B、File C、InputStream D、BufferedOutputStream15.在編寫Java Applet程序時(shí),需在程序的開頭寫上( )語(yǔ)句。 ReturnType method(byte x, double y) { return (short) x/y*2。 String s2=new String(hello)。 i ++ ) { int k = i。 i。 while (true) { (請(qǐng)輸入一個(gè)字符串: )。class Animal { Animal() { (Animal )。如下哪個(gè)是Java中有效的關(guān)鍵字() A、name B、hello C、false D、good下面的代碼段執(zhí)行之后count的值是什么( ) int count = 1。 D、(p,North)。 D、import .*。Java中用于定義小數(shù)的關(guān)鍵字有兩個(gè):( ) 和 ( ),后者精度高于前者。1以下程序段的輸出結(jié)果是( ) int x = 5, y = 6, z = 4。 for (int i = 1。 } public static void main(String[] args) { Person c = new Person(Peter, 17)。 cUnit = unit。 public void setWeight(float weight) { = weight。 int age。 public Son(String name, int age) { super(name, age)。 ()。 }}四、簡(jiǎn)答題簡(jiǎn)述Java中異常處理的機(jī)制?答:首先Java的異常是面向?qū)ο蟮摹J裁词抢^承?答:通過(guò)必要的說(shuō)明能夠?qū)崿F(xiàn)某個(gè)類無(wú)需重新定義就擁有另一個(gè)類的某些屬性和方法,并把這種關(guān)系稱為繼承,先定義的類稱為父類,后定義的類稱為子類,并且允許多層的繼承關(guān)系。 public Rectangle(float width, float height) { = width。}class Bird implements Animal { public void run() { (鳥兒在飛...)。import 。/* * 主窗體 */public class MyFrame extends Frame { private static final long serialVersionUID = 6895463895656626294L。 // 關(guān)閉菜單項(xiàng) MenuItem miCopy。 miClose = new MenuItem(關(guān)閉)。 (new WindowHandler())。 (miPaste)。 // 退出應(yīng)用程序 } } }}public class TestMyFrame { public static void main(String[] args) { // 啟動(dòng)主窗體 MyFrame guiWindow = new MyFrame()。,(x)后,數(shù)組x中的元素值
點(diǎn)擊復(fù)制文檔內(nèi)容
規(guī)章制度相關(guān)推薦
文庫(kù)吧 www.dybbs8.com
備案圖鄂ICP備17016276號(hào)-1