JAVA期末考试试卷_第1页
JAVA期末考试试卷_第2页
JAVA期末考试试卷_第3页
JAVA期末考试试卷_第4页
JAVA期末考试试卷_第5页
已阅读5页,还剩4页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

1、JAVA期末考试试卷,Systemoutprint(exstr+ and ); 天津城市建设院学 2007,2008年第二期学学,Sytemoutprint(exch); java 设言程序设设A 设设 A 卷 设程 , 号 073101-0 public void change(String str,char ch)班str=test ok; 设号一二三四五六七八九设分ch0=g; 得分、 、 、 B good and abc Bgood and gbc Ctest ok and abc Dtest okand gbc , 行下列程序运会设生什设设果5, ( )public class X

2、extends Thread implements Runable 设卷设明 , 设卷考设设设 120 分设。 public void run() 号学 ,,Systemoutprintln(this isrun()”); 密 得分一、空;填本设共空每空分共分,15230 ,如果一个源程序文件中定设有个设使用公司的设设器设设设源程序文1java4sunJDKjavac public static void main(String args)件设生将个与文件名设名相同设展名设的字设设文件。 4.Class , 中所有设都是设 的子设。2Java_Object_Thread t=new Threa

3、d(newX();,设出在填,包中下列基本据设型相设设的封设,与数装,“ 3javalangfloatjavalangFloat,tstart();一,o char_ javaLang.char booleanjavaLang.boolean, 被设设字修设的方法是不能被前设的子设重新定设的方法当final封 ,设程的四设设是状新建、运行、中 、断死亡。 、 第一行设生设设设设会、 第六行设生设设设设会 A B名 姓 java.lang.Objet , 设言中是所有设的根。 6java、 第六行设生行设设会运、 程序行和设会运启 CD, 的事件设理机制包括事件的设者听、事件和事件设理者。 7S

4、wing,要文件从, 文件中设出第个字设到设量中下列方法适合哪个6 filedat10C,? ( ), 是的设。写 8URLUniform Resourse Locator 、 ,AFileInputStreamin=new FileInputStream(filedat); inskip(9); int c=inread(); ,有设设用程序两和。 9javajava Applicationjavaapplet 、 ,BFileInputStream in=new FileInputStream(filedat);inskip(10); int c=inread(); , 设设字符以设设。1

5、0_、 ,CFileInputStream in=new FileInputStream(filedat); int c=inread(); 得分二、设设;本设共小设每设分共分,20240、,,,D RandomAccessFile in=new RandomAccessFile(filedat); inskip(9); intc=inreadByte();,欲造构设的一设例此设设承了个接口下列方法是正的,哪个确1ArrayListList(),容器被重新设置大小后设布局管理器的容器中的设件大小不容器大小的设化而改设, 哪随7()、;, 、;, AArrayList myList=new Ob

6、ject BList myList=newArrayList 、 、 、 、 ACardLayout BFlowLayout CBorderLayout DGridLayout、;, 、;, CArrayList myList=new ListDList myList=new List, 设出 下面代设 , 8, 方法使用设设型的哪参数2paint()? ( )public class Person、 、 A Graphics BGraphics2D CString DColorstatic int arr= new int10;, 指出正的表式 确达 3( ) public static v

7、oid main(Stringa)、 、 、 、 ,Abyte=128; BBoolean=null; Clong l=0 xfffL; Ddouble=09239d;, 指出下列程序行的设果运 4( ) ,Systemoutprintln(arr1); publicclass ExampleString str=new String(good); charch=a,b,c;那设句是正的 , 个确 ( )public static void main(String args儿、 设设设设生设设 将、设设设正行设设生设设确运将ABExample ex=new Example();,exchang

8、e(exstr,exch);A 卷第 1 设共 3 设、设出零、设出空。、第行、第行、第行、第行C DA3B6c7 D 8, 下列那是反斜的正表示,;,个杠确,设和是设的子设914TeacherStudentPerson 、 、 、 、 D Person p;Teacher t; 班 , 下列些设句设于存回收的设明是正的哪内确 ; ,10? Student s;、程序设必设设建一设程设放存个来内 ,A/p, t and s are allnon-null 、 存回收程序设设设放无用存内内B if(t instanceof Person) s = (Student)t; 、存回收程序允设程序设直

9、接设放存内内最后一句设旬的设果是, ; ,C、存回收程序可以在指定的设设设放存设象内内、造一将构个设象、表式是合法的 达DAStudentB。,下列代设行出设哪几会;,、表式是设设的 达、设设设正但行设设设。 确运 11: C D, 设出下面代设段1) public void modify() 15int I, j, k; 1) public class Test 号学 3) I = 100; 2)int m, n; 密while ( I 0 ) 3) public Test() j = I * 2; 4) public Test(int a) m=a; ,6) Systemoutprintl

10、n ( The value of j is + j ); 5) publicstatic void main(String arg) k = k + 1; 6) Test t1,t2;I-; 7) int j,k; 8) j=0; k=0;10 9) t1=new Test(); 封 、 Aline 4 Bline 6 Cline 7 Dline810) t2=new Test(j,k); 名 姓,是型成设设量设量设保持设常量用设短设句定 设设设量。 ; 个 12MAX_LENGTHintpublic, 10011) ,12) 、 行引起一设设设设设, ; , 哪将个 Apublic int

11、MAX_LENGTH=100;、 、 、 、 、 Bfinal int MAX_LENGTH=100; Aline 3 Bline 5 Cline 6 Dline 10、 , 设于下列代设, Cfinal public int MAX_LENGTH=100; 16、 , D public final int MAX_LENGTH=1001) class Person , 设出下面代设,, 132) public voidprintValue(int i, int j) /, 1) class Parent 3) publicvoid printValue(int i)/2 private St

12、ring name; 4) 3 public Parent() 5) public class Teacher extends Person, 4 6) public void printValue() /,5) publicclass Child extends Parent 7) public void printValue(int i) /6 private String department; 8) public static void main(Stringargs)7 public Child() 9) Person t = newTeacher();,8 public Strin

13、g getValue() return name; 10)tprintValue(10);9 public static void main(String arg) 11) 第行设句设用行设句 ,; , 将哪 10 Parent p = new Parent(); 10、 、 、 、 11 Aline 2 Bline 3 Cline 6 D line 7, 设设字可以抛出常 , ; , 哪个异 12 17那些行引起设设, ; , 将A 卷第 2 设共 3 设、 Atransient Bfinally C throw Dstatic Panel p=new Panel();,方法的返回设型是,

14、; ,18Main()、 、 Aint B void Cboolean Dstatic public Test(),;,布局管理器使容器中各件呈格布局平局占据容器空设。个构网19班 、 、 AFlowLayout BCardLayout C GridLayout DBorderLayoutf.setSize(200,200);, 设于下列代设, 20f.add(p);public class Parent p.add(b1); public int addValue( int a, int b) p.add(b2);int s; f.setVisible(true);s = a+b; b1.a

15、ddActionListener(newActionListener()return s; Override public void actionPerformed(ActionEvent arg0) 号学 bl.setVisible(false); 密class Child extends Parent );下述些方法可以加入设哪 ; ,Child? b2.addActionListener(newActionListener() 、 ,Aint addValue( int a, int b )/ do somethingOverride、 ,Bpublic void addValue (i

16、nt a, int b )/ do something publicvoid actionPerformed(ActionEvent arg0) 、 ,Cpublic int addValue( int a )/ do somethingb2.setEnabled(false); 、 , D public int addValue( int a, int b )throwsMyException /do something 封 );名 姓三、判设;断本设共小设每设分共分,5210得分下面的设法正的打”?”设设的打“确X public static voidmain(String口 args),

17、程序中抛出常设异只能抛出自己定设的常设象。异1( X ) (throw )Test T=new Test();,设中的是一设入设象。个 2(?)Systemin,设设一接口设在设中一定要设设接口中的所有方法。个,设程序在设端打印写之设的素。数3(? ) 21100, 所有的文件设入设出流都设承于设设。 4(X )/InputStream/OutputStreamclass TestChoose, 一常设理中 个异设句设只能有一或者可以有。个没 5(? ) finallypublic static voidmain(String args)int n=2;得分四、 设程设;本设共小设每设分共分,21020while(n=100), 设一设于按设的演示程序写个设建按设两个设设各自设设一事件接收器, 设于它个点设 1,button1,boolean flag=true;设按设后设按设改成不可设的设, 设于将状点设设按设设按设改成不可用设。将状 button2,int k1=2;while(

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论