ImageVerifierCode 换一换
格式:DOCX , 页数:19 ,大小:22.74KB ,
资源ID:17108036      下载积分:1 金币
快捷下载
登录下载
邮箱/手机:
温馨提示:
快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。 如填写123,账号就是123,密码也是123。
特别说明:
请自助下载,系统不会自动发送文件的哦; 如果您已付费,想二次下载,请登录后访问:我的下载记录
支付方式: 支付宝    微信支付   
验证码:   换一换

加入VIP,免费下载
 

温馨提示:由于个人手机设置不同,如果发现不能下载,请复制以下地址【https://www.bingdoc.com/d-17108036.html】到电脑端继续下载(重复下载不扣费)。

已注册用户请登录:
账号:
密码:
验证码:   换一换
  忘记密码?
三方登录: 微信登录   QQ登录  

下载须知

1: 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。
2: 试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。
3: 文件的所有权益归上传用户所有。
4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
5. 本站仅提供交流平台,并不能对任何下载内容负责。
6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

版权提示 | 免责声明

本文(java面试题A卷要点.docx)为本站会员(b****0)主动上传,冰点文库仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知冰点文库(发送邮件至service@bingdoc.com或直接QQ联系客服),我们立即给予删除!

java面试题A卷要点.docx

1、java面试题A卷要点空间互动笔试题(A)1.下列数组初始化正确的是:CA int5 a= 1,2,3,4,5;B int22 a = 1,2,3,4;C int a = 2,3,4,5,new int3;D int a = new int5;2.关于下述程序:public class Dividepublic static void main(String args)System.out.println(”17。0/0 = ”+17。0/0); System。out。println(”17/0 = ”+17/0); 描述正确的是?CA. 编译出错B。 编译通过,运行时/1、/2处均出现异常C

2、。 编译通过,运行时/1处得到一个无穷大值,/2处将出现异常D。 编译通过,运行时/1处出现异常,/2处将得到一个无穷大值3.关于下面的类描述中正确的是:Cclass Test void test(int i) System。out。println(I am an int.”); void test(String s) System.out。println(”I am a string.); public static void main(String args) Test t=new Test(); char ch=y; t.test(ch); A。 编译出错B. 编译通过,运行出错C. 编

3、译通过,运行时输出“I am an int”D. 编译通过,运行时输出“I am a string4.当编译和运行下列程序段时,会发生什么?Cclass Base class Sub extends Base class Sub2 extends Base public class CEx public static void main(String argv) Base b = new Base(); Sub s = (Sub) b; A 通过编译和并正常运行。 B 编译时出现错误。 C 编译通过,运行时出现异常。 D 以上都错5.下面哪些是java语言中的关键字? B A sizeof B

4、 abstract C NULL D Native 6.class ExSuper String name; String nick_name; public ExSuper(String s,String t) name = s;nick_name = t; public String toString() return name; public class Example extends ExSuper public Example(String s,String t) super(s,t); public String toString() return name +”a。k。a”+ni

5、ck_name; public static void main(String args)ExSuper a = new ExSuper(”First”,”1st”);ExSuper b = new Example(Second”,”2nd);System。out。println(a is”+a.toString());System。out.println(”b is”+b。toString();运行结果是 C A 编译时会出现例外。 B 运行结果为:a is Firstb is second C 运行结果为:a is Firstb is Secong a。k。a 2nd D 运行结果为:a

6、is First a。k。a 1ndb is Second a.k.a 2nd7.public class Foo public static void main(String args) tryreturn; finallySystem。out.println(Finally”); 结果是: D A 程序正常运行,但不输出任何结果。 B 程序正常运行,并输出 ”Finally。 C 编译能通过,但运行时会出现一个例外。 D 因为没有catch语句块,所以不能通过编译。 8.package语句正确的是A A 必须在程序开头 B 不一定在程序开头 C 可以在import之后 D 包名可以以数字开

7、头 9.java中,关于char类型错误的是BA 占2字节B 可以存储一个英文字母C 不能存储一个汉字D 其对应的封装类是Character10.关于内部类错误的是:AA 静态内部类可以访问其外部类的非静态属性B 非静态内部类可以访问其外部类的静态属性C 内部类可以是protectedD 内部类可以是final的11.Vector 与 ArrayList正确的是: CA ArrayList 出现比Vector早 B ArrayList 速度比Vector慢 C ArrayList 没有同步保护,Vector具有同步保护 D ArrayList Vector 两者都是无序的集合”12.Which

8、 of the following lines of code will compile without error? DA. int i=0; if (i) System。out.println(“Hi); B. boolean b=true; boolean b2=true; if(b=b2) System.out.println(“So true”); C. int i=1; int j=2; if(i=1! j=2) System。out。println(“OK”); D。 int i=1; int j=2; if (i=1 j=2) System.out.println(“OK”);

9、 ”13.下列程序 Cclass A public static void main(String args) B b = new B(); b。run(); for (int i=0;i30;i+) System.out。println(”good”); class B extends Thread public void run() for (int i=0;i30;i+) System。out。println(”hello”); ;A 编译错误B 编译正确,执行时good hello交替输出C 编译正确,执行时先输出30个hello再输出30个goodD 编译正确,程序运行时出现异常14

10、.FileInputStream和FileOutputStream错误的是 CA 是字节流B 是节点流C 用其拷贝文件时,不能拷贝中文D 可以拷贝任何文本文件和2进制文件。15.一个类中那些内容可以在序列化时写入文件或发送到网络上 DA transient 修饰的属性B 静态属性C 方法D 类名16.What happens when you try to compile and run the following application? Choose all correct options. public class Z public static void main(String arg

11、s) new Z(); Z() Z alias1 = this; Z alias2 = this; synchronized(alias1) try alias2.wait(); System。out.println(“DONE WAITING”); catch (InterruptedException e) System.out。println(“INTERRUPTED”); catch (Exception e) System.out。println(“OTHER EXCEPTION”); finally System.out。println (“FINALLY); System。out

12、.println(“ALL DONE”); A. The application compiles but doesnt print anything。 B。 The application compiles and print “DONE WAITING” C。 The application compiles and print “FINALLY” D. The application compiles and print “ALL DONE” E. The application compiles and print “INTERRUPTED” 17.下列关于关系数据库的说法正确的是:A

13、 贮存在列下的数据不必具有相同数据类型.B 行是唯一的(没有完全相同的行)。C 列有顺序.D 行有顺序。18.以下sql语句正确的是:A select studentid,depart,count() from student group by depart;B select studentid,count() from student;C select depart,max(avg(age) from student group by depart;D select studentid,avg(score),max(score) from score group by studentid19

14、.在JSP中使用标记时,不会出现的属性是:A. name B. property C. value D.以上皆不会出现20.对于JavaBean的属性,下面哪种说法是不正确的: A JavaBean中不一定要有属性B JavaBean类可以不是public的C 要访问和修改JavaBean的属性,应该通过get/set方法 D 如果一个属性只提供了get方法,那么它是只读的 21.Page指令用于定义JSP文件中的全局属性,下列关于该指令用法的描述不正确的是:A page 作用于整个JSP页面.B 可以在一个页面中使用多个% page 指令.C 为增强程序的可读性,建议将 page %指令放在

15、JSP文件的开头,但不是必须的.D 指令中的所有属性只能出现一次.22.要让不同用户共享一个JavaBean的对象则该对象的范围应该设置为:A sessionB pageC applicationD request23.以下那种请求表明客户端只想接收到响应的头信息,并决定了接收文挡的大小,修改时间。A PUTB GETC TRACED HEAD24.关于自定义标签的使用不正确的是:A 必须在JSP页面中使用taglibB 必须经过web。xml映射C 必须存在tld文件D 自定义标签的类必须是public的25.下列,那几句话会造成空指针异常(NullPointerException) Str

16、ing s = null; 1。 if((s!=null) (s.length()0)) 2. if((s!=null) &(s。length()0) 3. if((s=null) (s。length()=0) 4。 if(s=null) | (s。length()=0))A 1B 2C 1 和 3D 2 和 426.struts框架中,关于FormBean,下列说法正确的是:A FormBean是一种数据bean,主要用来封装表单提交上来的数据,并把这些数据传递给ActionB 在FormBean中可以对页面上传递来的参数进行一下格式上的验证,这种验证是一种客户端的验证C 用户每次提交表单,

17、都会产生一个新的FormBean实例D 动态FormBean不能进行验证操作27.struts框架,那些说法正确?A Struts中无法完成上传功能B Struts框架基于MVC模式C Struts框架容易引起流程复杂、结构不清晰等问题D Struts可以有效地降低项目的类文件数目28.Linux 系统root密码忘记,用什么办法可以最方便的修改密码?A 用其他用户登陆,破解/etc/password文件B 将硬盘挂载到其他linux系统上进行恢复C 进入单用户模式进行修改D 清除lilo或者grub29.关于MIDP正确的是:A 所有的J2ME程序都必定会使用MIDPB MIDP也是一种Co

18、nfiguration(配置)C MIDP是全称是MIDlet ProgrammingD MIDP是建立在CLDC上的一种Profile30.关于XML和HTML语言的错误的是:A HTML语言不具有扩展性,XML语言具有很好的扩展性B HTML侧重结构话的描述内容,XML侧重表现信息的形式C HTML内容与显示为一体,XML则内容与显示相分离D HTML语言出现比XML语言早31.关于DOM和SAX错误的是 A 利用DOM解析xml时,整个文档驻留内存,文档很大时需要大量内存B SAX速度快,但编程比较难,仅能够串行解析xmlC SAX的速度不如DOM快D SAX分析器缺乏灵活性.32.关于

19、RMI错误的是A RMI中不能直接对对象实现实施远程调用,只能对对象的接口操作B RMI底层通过存根stub和框架skeleton实现C RMI中方法调用参数传递为值传递,传递参数必须可以序列化D RMI的服务器与客户机中内存地址完全互相映射,保证两边同步33.关于有状态会话Bean错误的是:A 在客户端程序引用期间维护Bean中所有实例数据的状态值B 多个客户不会同时共享同一个有状态SessionBean实例C 钝化过程就是容器调用ejbremove删除多余EJB实例的过程D 有状态会话Bean的生命状态包括不存在,准备好和钝化 34.关于实体Bean错误的是A 可以分为容器管理持久性(CM

20、P)和Bean管理持久性(BMP)B CMP中变量和数据库中的字段对应关系由Bean类中的代码表示C CMP中可以不用编写对数据库操作的代码,比较简单D BMP中必须有开发者编写数据库操作代码35.关于BMP和CMP比较错误的是:A BMP和CMP的声明周期管理机制是相同的,不同的是BMP的事务持久性管理机制交给Bean的开发者B CMP编程方便但是降低了Bean的开发能力C BMP比CMP灵活,常用来映射复杂的数据视图或者很难用CMP实现的复杂逻辑处理D 在客户端的调用BMP和CMP的方法是不相同的36.面向对象语言的三个特征 ABDA 封装B 继承C 抽象D 多态37.指出下列程序的运行结

21、果: Apublic class Example String str = new String(“good”); char char = a,b,c; public static void main(String args) Example ex= new Example(); ex。change(ex。str,ex.ch); System。out。print(ex。str=” and ); System。out.print(ex。ch);public void change(String str,char ch)str = “test ok”;ch0 = g;A good and abcB

22、 good and gbcC test ok and abcD test ok and gbc38.给出下面代码段 switch(m)case 0: System.out.println(“case 0”);case 1:System.out.println(“case 1”); break;case 2:default:System。out.println(“default”);下面哪些值将引起“default”的输出 BA 0B 1C 2D 339.关于session论述正确的有: C A 一个session可以对应数个用户B 一个session只能对应一个用户C 可以手动关闭一个sess

23、ionD session 如果不手动关闭,会一直存在Server中40.哪个关键字可以对对象加互斥锁? CA transientB synchronizedC serializeD static41.已知表T1中有2行数据,T2中有3行数据,执行SQL语句 “select a。* from T1 a,T2 b后,返回的行数为 CA 2B 3C 5D 642.已知表T1含有字段ID,CourseID和Score,且数据为 ID CourseID Score3 1 902 1 852 2 903 2 80则语句”select id,sum(score) from T1 group by ID”执行

24、结果为 BA ID sum(score) 3 170 2 175B ID sum(score) 2 175 3 170C ID sum(score) 2 170 3 175D ID sum(score) 3 175 2 17043.已知表tbl中字段land_ID建有索引,字段cust_id建有唯一索引,下列语句查询逻辑相同,其中执行效率最优的是 B A select * from tbl where land_id750 or (cust_id=180 or cust_id=560)B select from tbl where (cust_id=180 or cust_id=560) or

25、 land_id750C select * from tbl where land_id750 union select * from tbl where cust_id=180 union select from tbl where cust_id = 560D select from tbl where land_id750 union (select from tbl where cust_id=180 union all select from tbl where cust_id=560)44.已知表tbl中字段land_ID建有索引,字段cust_id建有唯一索引,下列语句查询逻辑相

26、同,其中执行效率最优的是 C A select from tbl where land_id750 or (cust_id=180 or cust_id=560)B select * from tbl where (cust_id=180 or cust_id=560) or land_id750C select from tbl where land_id750 union select * from tbl where cust_id=180 union select * from tbl where cust_id = 560D select * from tbl where land_

27、id750 union (select from tbl where cust_id=180 union all select from tbl where cust_id=560)45.存在两个结构相同的数据库表T1(col1,col2,col3)、T2(col1,col2,col3),写出一SQL语句将所有T1数据导入到T2表 D A select col1,col2,col3 from T1 into T2(col1,col2,col3)B insert T1 (col1,col,col3) into T2(col1,col2,col3)C insert into T2 (col1,co

28、l2,col3) as select col1,col2,col3 from T1D insert into T2(col1,col2,col3) select col1,col2,col3 from T1;46.用truncate和delete语句删除表中数据的区别 AA truncate 命令不记录日志B truncate 命令记录日志C delete命令不记录日志47.如下语句:select i.id_number, m.id_number from inventory i, manufacturer m where i.manufacturer_id = m。id_number order by inventory.description执行是错误的,请问以下措施哪个能够改正这个错误? C A 在order by字句中使用表的别名B where 字句中去掉表的别名C where字句中用表名代替表的别名D order by字句中去掉表名,只要字段名称即可48.变量v_time=23MAY-00, 如下那条语句返回值为01-JAN-00? A A select roun

copyright@ 2008-2023 冰点文库 网站版权所有

经营许可证编号:鄂ICP备19020893号-2