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

正文內(nèi)容

java課堂練習(xí)題(文件)

2025-08-22 19:06 上一頁面

下一頁面
 

【正文】 用哪種組件: ( ) A、 TextArea B、 Panel C、 Applet D、 Canvas 答案: D 界面如上題所示。 } public static void main(String args[]){ Aclass a=new Aclass()。 } } 以上程序運(yùn)行結(jié)果是: ( ) A、 Aclass Aclass B、 Bclass Bclass C、 Aclass Bclass D、 Bclass Aclass 答案: C 1 下列關(guān)于 Java 線程的說法那些是正確的( ) A、 每一個 Java 線程可以看成由代碼、一個真實(shí)的 CPU 以及數(shù)據(jù)三部份組成。 答案: D 1 運(yùn)行下列程序 , 會產(chǎn)生什么結(jié)果 ?( ) public class X extends Thread implements Runable{ public void run(){ (this is run())。 void foo(double d,final float f){ String s。 (123,123)。 C、 當(dāng)創(chuàng)建一個新線程時。 MyClass obj=new MyClass()。 Object 請?zhí)畛鲈? 包中與下列基本數(shù)據(jù)類型相對應(yīng)的封裝類: float:, char: , boolean: 。 } } 如果要用最簡捷的一行代碼實(shí)現(xiàn) //和上面一個參數(shù)的 … 注釋所指出的功能,請寫出你認(rèn)為最合適的一行代碼: this(a) 如果有一個類 MyFrame 是 Frame 的子類,能夠被不同包中的類所使用,同時又能夠?yàn)榫€程提供運(yùn)行代碼( run()方法),請寫出該類的聲明頭。 的長度是 5。 ( )錯, Java 只能單繼承 簡 答題: 閱讀程序 ,回答以下問題 、 public class InheritTest1{ public static void main (String[] args){ A aa。 ( )。 void show( ){ (Class A: +\ta=+a +\td=+d)。 void show( ){ (Class A: +\ta=+ +\td=+)。 else { if ( y 5 ) ( two )。 public class Applet1 extends Applet { public void paint( Graphics g ) { int c1, c2。 b1 = false。 ( b1 和 b2相或的結(jié)果是: + ( b1 | b2 ), 25, 45 )。 int age。 score=a2。 問題: 1), 的值各是什么? 2), 的值各是什么? 現(xiàn)有類說明如下: class A { int x=10。} } 問題: 1)類 B 是否能繼承類 A 的屬性 x? 2)若 b 是類 B 的對象,則 ()的返回值是什么? 3)若 b 是類 B 的對象,則 ()的返回值是什么? 4)類 A 和類 B 都定義了 x 屬性,這種現(xiàn)象稱為什么? 閱讀程序 (或程序片段 )并回答問題 。 public void paint(Graphics g) { int s=0。 ( + s, 30, 60)。 String str2=Hello, students! 。 ) { if ( ch2 == ?b39。b\39。 )。c39。b39。b39。 public void init( ) { b=new B( 39。 (g)。 } A( char c){ this( )。 B(float r1,float r2){ s1=r1。 s2=r2。 fibonacci(n)=fibonacci(n1)+fibonacci(n2), n≥2; 設(shè) m 是 long 型變量 ,下面是用遞歸算法求菲波那契數(shù)列的方法 : long fibonacci(long n) { if(n==0||n==1) return n。 public class Test56_Sort { public static void main(String args[ ]) { int[] a={42,99,5,63,95,36,2,69,200,96}。 (排序后的數(shù)據(jù)序列 :)。 i。 x[j]=x[j+1]。 */ } } public static void ShowArray(int b[]) { for(int i=0。 } } 問題: 如果將方法 Sort( )中的一對注釋符( /* */)去掉,程序輸出的結(jié)果是什么 ? 程序填空 : public class ____________ { int x, y。 public void paint(Graphics ____ ) { int i=689。 public class MyClass { public static void main(String args[ ]) { if( !=___) for(int i=0。 } } myprogram的定義 , 其中 A、 B 是該主類所在源程序中已定義的另兩個類的類名 : import java awt.*; import java applet.*; public class myprogram extends Applet//定義小程序的主類 { A a。 import 。 float sum=。 for ( int i = 0 。 } } 答案: 1. Myclass, int j 2. a, i= 3. 0, args[i] 4. void, new 5. float, sum 編程題 : 編寫一個輸出 Hello World! 的程序,用兩種方式實(shí)現(xiàn)( Application、Applet)。 public class HelloWorld extends Applet{ String s。 import .*。at39。 }catch (Exception e) {} String dateString = (currentTime)。 new ThreeTimeThread(third).start()。 } } public static void main(String args[]) throws Exception { new ThreeTimeThread(first).start()。 Date currentTime = new Date()。 class ThreeTimeThread extends Thread{ public ThreeTimeThread(String str){ super(str)。 } public void paint(Graphics g){ (s,25,25)。 } } import 。 i++ ) sum+= a[i]。 j 。 public class SumArray extends Applet { float[] a。 public ________ init( ) { a=new A( ); b=_____ B( )。 i++) (___________)。 } Java Application 的主類的定義,其功能是輸出所有命令行參數(shù)。 y=j。 i++) ( +b[i])。 } /* if(i==1||i==2) ShowArray(x)。 j。 } public static void Sort(int[] x) { int w。 ShowArray(a)。 } 問題 : 當(dāng)語句 m=fibonacci(3)。 ( +s1+ +s2,40,70)。 } B( char c, float r1, float r2) { super(c)。 } void Print(Graphics g) { ( +n+ +ch,20,70)。 char ch。, , )。 import .*。a39。w39。 問題 : 1)若執(zhí)行前 ch1 的值為 ?a39。 } else ( ch1!=\39。a\39。 (str2)。 能寫為 s +=x[i]。 i 。 import .*。} } class B extends A { int x=100。 s1=new student(張三 ,20,33)。 student(String a1,int a2,int a3) {name=a1。 ( ++c1 == c2為 + ( ++c1 == c2 ), 25, 105 )。 ( b1 和 b2相與的結(jié)果是: + ( b1 amp。 c1 = 5。 } 問題 : 1)若執(zhí)行前 x=6, y=8,該程序段輸出是什么 ? 2)若執(zhí)行前 x=1, y=8,該程序段 輸出是什么 ? import 。 (Class B: +\ta=+a +\td=+d+\tb=+b)。 String d=Java program.。 } } // public class A{ int a=1。 aa=new A( )。 ( )對 4. 一個類的定義包括定義類頭和定義類體兩個部分。 ( )對 \39。 public Example(int a){ …… .. x = a。其中 ________________的限定的范圍最大。 答案: ABD 填空題 包 包含了 Collection 的接口和類的 API。 } } A、 in the Inner outer B、 outer C、 in the Inner D、 編譯不通過 答案: B 多選: 哪個布局管理器使用的是組件的最佳尺寸( preferred size) ( ) A、 FlowLayout B、 BorderLayout C、 GridLayout D、 CardLayout E、 GridBagLayout 答案: A 和 E 下面哪個方法可以在任何時候被任何線程調(diào)用 ?( ) A、 notify() B、 wait() C、 notifyAll() D、 sleep() E、 yield() F、 synchronized(this) 答案: DEF 定義一個類名為 的類,并且該類可被一個工程中的所有類訪問,那么該類的正確聲明應(yīng)為:
點(diǎn)擊復(fù)制文檔內(nèi)容
公司管理相關(guān)推薦
文庫吧 www.dybbs8.com
備案圖鄂ICP備17016276號-1