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

正文內(nèi)容

java語言程序設(shè)計期末考試試題及答案-全文預(yù)覽

2025-07-15 18:37 上一頁面

下一頁面
  

【正文】 B)1 2 C) 1 3 D) 3 3 應(yīng)用程序的main方法中有以下語句,則輸出的結(jié)果是 ( )。 A) 9 B) true C) 1 D) false,在命令行鍵入: java Test aaa bb c回車后輸出的結(jié)果是 ( )。 String s2=(m+1)。 String s=12345aaabbb67890。 B),但只能向文件寫入數(shù)據(jù),不能從文件讀取數(shù)據(jù)。 ((a))。 Hashtable hashtable=new Hashtable()。 boolean b1=(s2)。in=new BufferedReader(file)。,(x)后,數(shù)組x中的元素值依次是( ).A) 2 7 8 12 35 B) 12 35 8 7 2 C) 35 12 8 7 2 D) 8 7 12 35 2下面的程序段創(chuàng)建了BufferedReader類的對象in。for (int i=0。 // 退出應(yīng)用程序 } } }}public class TestMyFrame { public static void main(String[] args) { // 啟動主窗體 MyFrame guiWindow = new MyFrame()。 private class WindowHandler extends WindowAdapter { public void windowClosing(WindowEvent e) { (0)。 (miPaste)。 // 將菜單項放入菜單中 (miOpen)。 (new WindowHandler())。 (100, 100)。 miClose = new MenuItem(關(guān)閉)。 // 創(chuàng)建菜單 mnuFile = new Menu(文件)。 // 關(guān)閉菜單項 MenuItem miCopy。 // 文件菜單 Menu mnuEdit。/* * 主窗體 */public class MyFrame extends Frame { private static final long serialVersionUID = 6895463895656626294L。import 。import 。 Fish fish = new Fish()。}class Bird implements Animal { public void run() { (鳥兒在飛...)。 } public static void main(String [] args) { Rectangle rect = new Rectangle(10, 20)。 public Rectangle(float width, float height) { = width。子類的對象使用這個方法時,將調(diào)用子類中的定義,對它而言,父類中的定義如同被“屏蔽”了。什么是繼承?答:通過必要的說明能夠?qū)崿F(xiàn)某個類無需重新定義就擁有另一個類的某些屬性和方法,并把這種關(guān)系稱為繼承,先定義的類稱為父類,后定義的類稱為子類,并且允許多層的繼承關(guān)系。其中try塊存放將可能發(fā)生異常的Java語言,并管理相關(guān)的異常指針;catch塊緊跟在try塊后面,用來激發(fā)被捕獲的異常;finally塊包含清除程序沒有釋放的資源,句柄等。 }}四、簡答題簡述Java中異常處理的機制?答:首先Java的異常是面向?qū)ο蟮摹?j 。 ()。 } public static void main(String args[]) { Son son = new Son(Tom, 15)。 public Son(String name, int age) { super(name, age)。 ( 年齡: + age)。 int age。 (20)。 public void setWeight(float weight) { = weight。 ()。 cUnit = unit。 private String cName。 } public static void main(String[] args) { Person c = new Person(Peter, 17)。public class Person { String name。 for (int i = 1。amp。1以下程序段的輸出結(jié)果是( ) int x = 5, y = 6, z = 4。當(dāng)聲明一個數(shù)組int arr[] = new int[5]。Java中用于定義小數(shù)的關(guān)鍵字有兩個:( ) 和 ( ),后者精度高于前者。 D、import .*。 D、import .*。 D、(“確定”)。 D、(p,North)。 } (count)。如下哪個是Java中有效的關(guān)鍵字() A、name B、hello C、false D、good下面的代碼段執(zhí)行之后count的值是什么( ) int count = 1。 下面哪個語句不是合法的( )A、s += books。class Animal { Animal() { (Animal )。 (s)。 while (true) { (請輸入一個字符串: )。import .*。 i。 int temp =a[i]。 i ++ ) { int k = i。public class TestArray{ public static void main(String args[ ]){ int i , j 。 String s2=new String(hello)。5.if((s))6. s=null。 ReturnType method(byte x, double y) { return (short) x/y*2。 D、import 。14.FilterOutputStream是BufferedOutputStream、DataOutputStream及PrintStream的父類,以下哪個類可能是FilterOutputStream構(gòu)造函數(shù)的參數(shù)類型?A、OutputStream B、File C、InputStream D、BufferedOutputStream15.在編寫Java Applet程序時,需在程序的開頭寫上( )語句。A、a是整數(shù)類型變量,b是整數(shù)類對象。 B、package mypackage。public static void main(String a[]) {   (arr[0])。 ( )二.單項選擇題1.Java application中的主類需包含main方法,以下哪項是main方法的正確形參?( )A、 String args B、String ar[] C、Char arg D、StringBuffer args[]2.以下關(guān)于繼承的敘述正確的是( )。 ( )6.擁有abstract方法的類是抽象類,但抽象類中可以沒有abstract方法。( ) 2.Java程序里,創(chuàng)建新的類對象用關(guān)鍵字new,回收無用的類對象使用關(guān)鍵字free。 SubSubClass(int aa, int bb, int cc) { super(aa, bb, cc)。 } } class SubClass extends SuperClass { int c。 i ++ ) if ( a[i]%3 = = 0 ) s += a[i] 。 public class abc { public static void main(String args[ ]) { int i, s = 0 。 public AB(String str1, String str2) { s1 = str1。public class abc{ public static void main(String args [ ]){ AB s = new AB(Hello!,I love JAVA.)。 i + + ) if ( i % 2 = = 1 ) s += MyIntArray[i] 。 則執(zhí)行以下幾個語句后的輸出結(jié)果是 。 方法是一種僅有方法頭,沒有具體方法體和操作實現(xiàn)的方法,該方法必須在抽象類之中定義。 A. static void method( ) B. public void method( ) C. final void method( ) D. abstract void method( )二、填空題開發(fā)與運行Java程序需要經(jīng)過的三個主要步驟為 、 和 ?!禞AVA語言程序設(shè)計》期末考試試題及答案1(應(yīng)考必備題庫)一、單選擇題編譯Java Application 源程序文件將產(chǎn)生相應(yīng)的字節(jié)碼文件,這些字節(jié)碼文件的擴(kuò)展名為( )。 A. public B. private C. static D. protected為AB類的一個無形式參數(shù)無返回值的方法method書寫方法頭,使得使用類名AB作為前綴就可以調(diào)用它,該方法頭的形式為( )。若x = 5,y = 10,則x y和x = y的邏輯值分別為 和 。設(shè)有數(shù)組定義:int MyIntArray[ ] = { 10 , 20 , 30 , 40 , 50 , 60 , 70}。 i 。三、寫出下面程序的運行結(jié)果 import .*。 String s2。}} import .* 。 i 。 public class abc { public static void main(String args[ ]) { (a=+a+\nb=+b)。 } } class SubSubClass extends SubClass { int a。 } }《JAVA語言程序設(shè)計》期末考試試題及答案2(應(yīng)考必備題庫)一.判斷題1.Java的源代碼中定義幾個類。 ( )5.在異常處理中,若try中的代碼可能產(chǎn)生多種異常則可以對應(yīng)多個catch語句,若catch中的參數(shù)類型有父類子類關(guān)系,此時應(yīng)該將父類放在后面,子類放在前面。 ( )9.在Java中對象可以賦值,只要使用賦值號(等號)即可,相當(dāng)于生成了一個各屬性與賦值對象相同的新對象。A、init() B、start() C、destroy() D、stop()8.給出下面代碼,關(guān)于該程序以下哪個說法是正確的?( )public class Person{ static int arr[] = new int[5]。( )1.2 .public class Interesting{3. //do sth 4.}A、import .*。 下述說法正確的是( )。 D、a和b都是整數(shù)類型變量并且值相等。C、import .* 。A、private B、protected C、private protected D、public1有以下方法的定義,請選擇該方法的返回類型( )。3.if((s1))4. s1=null。class StringTest1{ public static void main(String[] args) { String s1=hello。 } }}2.以下程序段的輸出結(jié)果為 。 i 。 j++ ) if ( a[j]a[k] ) k = j。 }
點擊復(fù)制文檔內(nèi)容
規(guī)章制度相關(guān)推薦
文庫吧 www.dybbs8.com
備案圖鄂ICP備17016276號-1