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

正文內(nèi)容

java語言程序設(shè)計期末考試試題及答案-文庫吧資料

2025-06-30 18:37本頁面
  

【正文】 )。 FileOutputStream file=new FileOutputStream(,true)。public class Test { public static void main(String args[]) { try { String s=ABCDE。A) B) C) 12 D) “” 1下面的程序創(chuàng)建了一個文件輸出流對象,將該程序運行3次, 的內(nèi)容是( )。 int y=(s2)。 String s1=, s2=12。 (+z)。 public static void main(String args[]) { int z=2。A) 125 B) 5 C) 98 D) 168 1( )。i++){ if(x[i] max) max =x[i]。for(int i=1。int[] x={125,21,5,168,98}。 } } (sum=+sum)。jb[i].length。i。 int sum=0。 } } A) 3 2 B)1 2 C) 1 3 D) 3 3 應(yīng)用程序的main方法中有以下語句,則輸出的結(jié)果是 ( )。 int k2=args[1].length()。 A) 9 B) true C) 1 D) false,在命令行鍵入: java Test aaa bb c回車后輸出的結(jié)果是 ( )。 A) 123456 B) 67890 C) aaa D) bbb 下面程序段執(zhí)行后b的值是( )。 String s2=(m+1)。 int k=(,n+1)。 String s=12345aaabbb67890。D) 以上說法都不對。 B),但只能向文件寫入數(shù)據(jù),不能從文件讀取數(shù)據(jù)。 RandomAccessFile raf2 = new RandomAccessFile(,rw )。 ((a))。 (y,67890)。 Hashtable hashtable=new Hashtable()。 (b1+ +b2)。 boolean b1=(s2)。 String s1=new String(abc)。in=new BufferedReader(file)。File f = new 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。 i+=2){ ((i))。for (int i=0。 }}《JAVA語言程序設(shè)計》期末考試試題及答案4(應(yīng)考必備題庫)一、 單選題下列程序段執(zhí)行后的結(jié)果是( )。 // 退出應(yīng)用程序 } } }}public class TestMyFrame { public static void main(String[] args) { // 啟動主窗體 MyFrame guiWindow = new MyFrame()。 } } // 定義一個內(nèi)部類,在這個類中編寫動作事件處理程序。 private class WindowHandler extends WindowAdapter { public void windowClosing(WindowEvent e) { (0)。 (new MenuHandler())。 (miPaste)。 (miClose)。 // 將菜單項放入菜單中 (miOpen)。 // 將菜單放入菜單欄中 (mnuFile)。 (new WindowHandler())。 (true)。 (100, 100)。 miPaste = new MenuItem(粘貼)。 miClose = new MenuItem(關(guān)閉)。 // 創(chuàng)建菜單項 miOpen = new MenuItem(打開)。 // 創(chuàng)建菜單 mnuFile = new Menu(文件)。 // 粘貼菜單項 public MyFrame() { frmMain = new Frame(主窗體)。 // 關(guān)閉菜單項 MenuItem miCopy。 // 打開菜單項 MenuItem miSave。 // 文件菜單 Menu mnuEdit。 // 窗體 MenuBar mb。/* * 主窗體 */public class MyFrame extends Frame { private static final long serialVersionUID = 6895463895656626294L。import 。import 。import 。import 。 }}編寫一個Frame框架應(yīng)用程序,要求如下:(1) 在窗口設(shè)置兩個菜單“文件”、“編輯”(2) 在“文件”菜單里添加三個菜單項“打開”、“保存”、“關(guān)閉”(3) 在“編輯”菜單里添加兩個菜單項“復(fù)制”、“粘貼”(4) 點擊關(guān)閉菜單項時,使程序關(guān)閉。 Fish fish = new Fish()。 }}public class TestAnimal { public static void main(String[] args) { Bird bird = new Bird()。}class Bird implements Animal { public void run() { (鳥兒在飛...)。 (面積是: + ())。 } public static void main(String [] args) { Rectangle rect = new Rectangle(10, 20)。 } public float getLength(){ return ( + ) * 2。 public Rectangle(float width, float height) { = width。Overloaded的方法是可以改變返回值的類型。子類的對象使用這個方法時,將調(diào)用子類中的定義,對它而言,父類中的定義如同被“屏蔽”了。重寫Overriding是父類與子類之間多態(tài)性的一種表現(xiàn),重載Overloading是一個類中多態(tài)性的一種表現(xiàn)。什么是繼承?答:通過必要的說明能夠?qū)崿F(xiàn)某個類無需重新定義就擁有另一個類的某些屬性和方法,并把這種關(guān)系稱為繼承,先定義的類稱為父類,后定義的類稱為子類,并且允許多層的繼承關(guān)系。:Java語言可以不在方法中直接捕獲,而用throw語句將異常拋給上層的調(diào)用者。其中try塊存放將可能發(fā)生異常的Java語言,并管理相關(guān)的異常指針;catch塊緊跟在try塊后面,用來激發(fā)被捕獲的異常;finally塊包含清除程序沒有釋放的資源,句柄等。Java的異常處理是通過5個關(guān)鍵詞來實現(xiàn)的:try,catch,throw,throws和finally。 }}四、簡答題簡述Java中異常處理的機制?答:首先Java的異常是面向?qū)ο蟮摹?} public static void main(String[] args) { MyClass my = new MyClass()。 j 。public class MyClass { int a[] = { 1, 2, 3, 4, 5 }。 ()。 = 九中。 } public static void main(String args[]) { Son son = new Son(Tom, 15)。 ()。 public Son(String name, int age) { super(name, age)。 ( 電話: + tel)。 ( 年齡: + age)。 = age。 int age。 }}以下程序的輸出結(jié)果_ _。 (20)。 } public static void main(String[] args) { = 湯姆貓。 public void setWeight(float weight) { = weight。public class Tom { private float weight。 ()。 }}class CourseTest { public static void main(String[] args) { Course c。 cUnit = unit。 public Course(String number, String name, int unit) { cNumber = number。 private String cName。 }}以下程序的輸出結(jié)果為__ ___。 } public static void main(String[] args) { Person c = new Person(Peter, 17)。 public Person(String name, int age) { = name。public class Person { String name。 i) (a[i] + )。 for (int i = 1。 else (不是三角形)。amp。amp。1以下程序段的輸出結(jié)果是( ) int x = 5, y = 6, z = 4。假設(shè)x=13,y=4,則表達式x%y != 0的值是( ),其數(shù)據(jù)類型是( )。當(dāng)聲明一個數(shù)組int arr[] = new int[5]。在Java中定義一個字符串類型的變量str的語句是:( ) ,定義一個具有10個元素的整型數(shù)組a的語句是:( ) 。Java中用于定義小數(shù)的關(guān)鍵字有兩個:( ) 和 ( ),后者精度高于前者。Java程序中的單行注釋符是( // ),多行注釋符是( )。 D、import .*。 B、import .*。 D、import .*。 B、import .*。 D、(“確定”)。 B、button b=new button()。 D、(p,North)。 B、(b,North)。 } (count)。 i = 5。如下哪個是Java中有效的關(guān)鍵字() A、name B、hello C、false D、good下面的代碼段執(zhí)行之后count的值是什么( ) int count = 1。C、int len = 。 下面哪個語句不是合法的( )A、s += books。 } public static void main(String[] args) { Dog snoppy= new Dog()。class Animal { Animal() { (Animal )。 } ()。 (s)。 s=()。 while (true) { (請輸入一個字符串: )。 BufferedWriter bw = new BufferedWriter(new FileWriter(“))。import .*。 ( )。 i。 a[k] = temp。 int temp =a[i]。 j 。 i ++ ) { int k = i。 for ( i = 0 。public class TestArray{ publ
點擊復(fù)制文檔內(nèi)容
規(guī)章制度相關(guān)推薦
文庫吧 www.dybbs8.com
備案圖鄂ICP備17016276號-1