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

正文內(nèi)容

java課堂練習(xí)題-閱讀頁(yè)

2024-08-21 19:06本頁(yè)面
  

【正文】 B、 Panel C、 Applet D、 Canvas 答案: D 界面如上題所示。如果在 A 區(qū)域使用某種 AWT 組件( 的子類(lèi))來(lái)負(fù)責(zé)繪制圖像 ,則繪圖的語(yǔ)句最好應(yīng) 放在該組件的哪個(gè)方法中 (考慮到應(yīng)用程序和 Java 虛擬機(jī)的 AWT 線(xiàn)程都會(huì)要求重畫(huà)該組件 )?( ) A、 構(gòu)造方法 B、 paint( Graphics g) C、 update( Graphics g) D、 repaint() 答案: B 下面關(guān)于 Applet 的說(shuō)法正確的是 ( ) A、 Applet 也需要 main 方法 B、 Applet 必須繼承自 C、 Applet 能訪問(wèn)本地文件 D、 Applet 程序不需要編譯 答案: B 指出下列程序運(yùn)行 的結(jié)果 ( ) public class Example{ String str=new String(good)。a39。b39。c39。 public static void main(String args[]){ Example ex=new Example()。 (+ and )。 } public void change(String str,char ch[]){ str=test ok。g39。 } public static void main(String args[]){ Thread t=new Thread(new X())。 } } A、 第一行會(huì)產(chǎn)生編譯錯(cuò)誤 B、 第六行會(huì)產(chǎn)生編譯錯(cuò)誤 C、 第六行會(huì)產(chǎn)生運(yùn)行錯(cuò)誤 D、 程序會(huì)運(yùn)行和啟動(dòng) 答案: A 要從文件 “ ” 文件中讀出第 10個(gè)字節(jié)到變量 C中 , 下列哪個(gè)方法適合 ?( ) A、 FileInputStream in=new FileInputStream()。 int c=()。 (10)。 C、 FileInputStream in=new FileInputStream()。 D、 RandomAccessFile in=new RandomAccessFile()。 int c=()。若 Button1的功能是:點(diǎn)擊后彈出一個(gè)用于輸入的界面,獲取用戶(hù)想要顯示的圖像文件名,則該界面最好是(從編程簡(jiǎn)單和程序不易出錯(cuò)的角度考慮) :( ) A、 模式( Modal) Dialog B、 非模式( Nonemodal) Dialog C、 FileDialog D、 Frame 答案: C 1 界面如上題所示。 } } public class Bclass extends Aclass{ void go{ (Bclass)。 Aclass a1=new Bclass()。 ()。 B、 創(chuàng)建線(xiàn)程的兩種方法中,從 Thread 類(lèi)中繼承的創(chuàng)建方式可以防止出現(xiàn)多父類(lèi)問(wèn)題。 D、 以上說(shuō)法 無(wú)一正確。 } public static void main(String args[]) { Thread t=new Thread(new X())。 } } A、 第一行會(huì)產(chǎn)生編譯 錯(cuò)誤 B、 第六行會(huì)產(chǎn)生編譯錯(cuò)誤 C、 第六行會(huì)產(chǎn)生運(yùn)行錯(cuò)誤 D、 程序會(huì)運(yùn)行和啟動(dòng) 答案: A 1 運(yùn)行下列程序,會(huì)產(chǎn)生什么結(jié)果: ( ) class Outer1{ private int a。 final boolean b。 } } } public static void main(String args[]) { Outer1 me=new Outer1()。 (outer)。 B、 當(dāng)該線(xiàn)程調(diào)用 sleep()方法時(shí)。 D、 當(dāng)一個(gè)優(yōu)先級(jí)高的線(xiàn)程進(jìn)入就緒狀態(tài)時(shí)。 聲明并創(chuàng)建類(lèi) MyClass 的一個(gè)對(duì)象,其名稱(chēng)為 obj,可通過(guò)以下語(yǔ)句實(shí)現(xiàn):________________。 3 、 Java 中類(lèi)成員的限定詞有以下幾種: private , public , ________________ ,________________。 Protected, default, public Java 中所有類(lèi)都是類(lèi) 的子類(lèi)。, 給定下面的未完成的代碼片斷: public class Example{ int x,y。 } public Example(int a, int b){ //和上面一個(gè)參數(shù)的構(gòu)造方法做同樣的操作,包括賦值 x=a y = b。 你的解答: public class MyFrame extends Frame implements Runnable 判斷題 和 c++都是面向?qū)ο蟮某绦蛟O(shè)計(jì)語(yǔ)言。a\39。 ( )錯(cuò),長(zhǎng)度為 3,因?yàn)槔锩姘藘蓚€(gè)轉(zhuǎn)義字符 3. 同一個(gè)類(lèi)中定義多個(gè)參數(shù)列表不同的同名方法 ,叫做方法的重載。 ( )對(duì) ,也可以有多個(gè)主類(lèi)。 B bb。 bb=new B( )。 ()。 double d=。 } } // public class B extends A{ float a=。 int b=4。 ( )。 } } 問(wèn)題: 1) 這是哪一類(lèi) java 程序 ? 2) 類(lèi) A和類(lèi) B是什么關(guān)系? 3) 按程序輸出的格式寫(xiě)出程序運(yùn)行后的結(jié)果 . 閱讀下面的程序段 ,回答以下問(wèn)題 if ( x 5 ) ( one )。 else ( three )。 import 。 boolean b1, b2。 c2 = 7。 b2 = true。 b2 ), 25, 25 )。 ( c1= + ++c1, 25, 85 )。 } } 問(wèn)題 : 1)程序執(zhí)行后共輸出幾行 ? 2)輸出結(jié)果是什么 ? 現(xiàn)有一個(gè)類(lèi)定義如下 : class student { String name。 int score=88。 age=a3。} } 在使用該類(lèi)時(shí) ,已使用下面語(yǔ)句生成了該類(lèi)的對(duì)象 : student s1,s2。 s2=new student()。 int GetA(){return x。 int GetB(return x。 1. import .*。 public class Test51` extends Applet { float[ ] x = {, , , }。 for( int i = 0。 i++ ) s += (int)x[i]。 } } 問(wèn)題: 1)程序的輸出結(jié)果是什么 ? 2)方法 paint()中的循環(huán)體 s += (int)x[i]。 嗎 ? 為什么 ? 2. public class Test52 { String str1=Hello, Java world! \t。 public static void main(String args[]) { (str1)。 } } 問(wèn)題: 1)這是哪種形式的 Java 程序 ? 2)程序的輸出是什么?輸出的結(jié)果在 Applet 窗口中嗎 ? 3. 設(shè) ch1, ch2 是 char 型變量: if ( ch1 == ?a39。 ) ( ch1=\39。 , ch2=\39。 )。a\39。 ( end )。, ch2 的值為 39。 該程序段輸出是什么 ? 2)若執(zhí)行前 ch1 的值為 39。, ch2 的值為 39。 該程序段輸出是什么 ? 3)若執(zhí)行前 ch1 的值為 39。, ch2 的值為 39。 該程序段輸出是什么 ? : import .*。 public class Test54 extends Applet { B b。f39。 } public void paint(Graphics g) { (序號(hào) +性別 +成績(jī) 1 +成績(jī) 2 ,20,50)。 } } class A { static int n=100。 A( ) { n++。 ch=c。 } } class B extends A { float s1, s2。 s2=r2。 s1=r1。 } void Print(Graphics g) { (g)。 } } 問(wèn)題 : 該程序的輸出是什么 ? : fibonacci(n)=n, n=0,1。 else return (fibonacci(n1)+fibonacci(n2))。 執(zhí)行時(shí),方法 fibonacci( )被調(diào)用了幾次 ? 6. 下面是一個(gè)排序的程序 : import .*。 (排序前的數(shù)據(jù)序列 :)。 Sort(a)。 ShowArray(a)。 for(int i=1。 i++) { for(int j=0。 j++) if(x[j]x[j+1]) { w=x[j]。 x[j+1]=w。 if(i==2) break。 i。 ( )。 Myclass ( int i, _______) // 構(gòu)造函數(shù) { x=i。 } } Applet 類(lèi)中方法 paint( ) 的重新定義。 ( ________+ i ,20,60)。 import .*。 i 。 else (沒(méi)有命令行參數(shù) )。 B b。 } } 元素的和。 import 。 a= new _______[6]。 public void init( ) { for ( int j = 0。 j++ ) a[j] = j+1。 i 。 } public void paint( Graphics g ) { ( Total of array elements: + ________ , 25, 25 )。 public class HelloWorld{ public static void main(String[] args){ (Hello,World!)。 import 。 public void init(){ s=Hello World!。 } } 編寫(xiě)一個(gè)應(yīng)用程序,創(chuàng)建三個(gè)線(xiàn)程分別顯示各自的時(shí)間。 import .*。 } public void run() { while (true) { SimpleDateFormat formatter = new SimpleDateFormat ( G 39。 hh:mm:ss z)。 try { sleep(1000)。 (getName()+:+dateString)。 new ThreeTimeThread(second).start()。 } }
點(diǎn)擊復(fù)制文檔內(nèi)容
公司管理相關(guān)推薦
文庫(kù)吧 www.dybbs8.com
備案圖鄂ICP備17016276號(hào)-1