javazx 发表于 2016-7-27 14:26:35

【java笔试题】某金融公司java面试题 中级 珍藏

java软件工程师笔试题目(I)    规则:1. 时间:40分钟2. 个人独立完成,不能使用手机等上网上查询。如果被发现作弊,则零分。3. 为了环保和节约纸张,请在答题卡上填写答案 一、不定项选择题(每题5分)Question 1Given:11. public class Test {
12. public static void main(String [] args) {
13. int x =5;
14. boolean b1 = true;
15. boolean b2 = false;
17.if((x==4) && !b2)
18. System.out.print(”l “);
19. System.out.print(”2 “);
20. if ((b2 = true) && b1)
21. System.out.print(”3 “);
22. }
23. }
What is the result?
A. 2
B. 3
C. 1 2
D. 2 3
E. 1 2 3
F. Compilation fails.
G. Au exceptional is thrown at runtime. Question 2Assume that country is set for each class.Given:10. public class Money {
11. private String country, name;
12. Public String getCountry() { return country; }
13.}and:24. class Yen extends Money {
25. public String getCountry() { return super.country; }
26. }
27.
28. class Euro extends Money {
29. public String getCountry(String timeZone) {
30. return super.getCountry();
31. }
32. }
Which two are correct? (Choose two.)A. Yen returns correct values.
B. Euro returns correct values.
C. An exception is thrown at runtime.
D. Yen and Euro both return correct values.
E. Compilation fails because of an error at line 25.
F. Compilation fails because of an error at line 30. Question 3Given:10. package com.billionsfinance.test;
11. public class Geodetics {
12. public static final double DIAMETER = 12756.32; // kilometers
13. }
Which two correctly access the DIAMETER member of the Geodetics class? (Choose two.)A. import com.billionsfinance.test.Geodetics;
public class TerraCarta {
public double halfway()
{ return Geodetics.DIAMETER/2.0; } } B. import static com.billionsfinance.test.Geodetics;
public class TerraCarta {
public double halfway() { return DIAMETER/2.0; } }C. import static com.billionsfinance.test.Geodetics. *; public class TerraCarta {
public double halfway() { return DIAMETER/2.0; } }D. package com.billionsfinance.test;
public class TerraCarta {
public double halfway() { return DIAMETER/2.0; } } Question 4Given:1. class TestA {
2. public void start() { System.out.println(”TestA”); }
3. }
4. public class TestB extends TestA {
5. public void start() { System.out.println(”TestB”); }
6. public static void main(String[] args) {   
7. ((TestA)new TestB()).start();
8. }
9. }
What is the result? A. TestA
B. TestB
C. Compilation fails.
D. An exception is thrown at runtime. Question 5Given:11. public static void main(String[] args) {
12. String str = “null’;
13. if (str == null) {   
14. System.out.println(”null”);
15. } else (str.length() == 0) {   
16. System.out.println(”zero”);
17. } else {
18. System.out.println(”some”);
19. }
20. }
‘What is the result?A. null
B. zero
C. some
D. Compilation fails.
E. An exception is thrown at runtime. Question 6Given:33. try {
34. // some code here
35. } catch (NullPointerException e1) {
36. System.out.print(”a”);
37. } catch (RuntimeException e2) {
38. System.out.print(”b”);
39. } finally {
40. System.out.print(”c”);
41. }
What is the result if a NullPointerException occurs on line 34?
A. c
B. a
C. ab
D. ac
E. bc
F. abc Question 7Given:1. public class TestString 1 {
2. public static void main(String[] args) {
3. String str = “420”;
4. str += 42;
5. System.out.print(str);
6. }
7. }
What is the output?A. 42
B. 420
C. 462
D. 42042
E. Compilation fails.
F. An exception is thrown at runtime. Question 8Given this method in a class:21. public String toString() {
22. StringBuffer buffer = new StringBuffer();
23. buffer.append(’<’);
24. buffer.append(this.name);
25. buffer.append(’>’);
26. return buffer.toString();
27. }
Which is true?A. This code is NOT thread-safe.
B. The programmer can replace StringBuffer with StringBuilder with no
other changes.
C. This code will perform well and converting the code to use
StringBuilder will not enhance the performance.
D. This code will perform poorly. For better performance, the code
should be rewritten: return “<“+ this.name + “>”; Question 9 哪个语句不会建立隐式事务? A.INSERT   B.UPDATE   C.DELETE   D.SELECT FOR UPDATEE.以上语句都会建立隐式事务 Question 10EMP表不是分区表和索引化表,执行以下语句,哪两个说法是正确的? ALTER TABLE emp DROP COLUMN first_name;

A. FIRST_NAME列将被删除,如果该列不包含数据;
B. FIRST_NAME列将被删除,如果它不是表中仅有的列; C. 如果以上SQL语句加上SET UNUSED子句,FIRST_NAME列可以被回滚; D. 如果以上SQL语句加上CASCADE子句,FIRST_NAME列可以被删除,即使它是主码列。 Question 11关于子查询以下哪两种说法是正确的?A. 外层查询返回结果之后,执行内层查询 B. 先执行子查询,再执行外层查询 C. 对于子查询返回的结果,外层查询只执行一次 D. 外层查询返回的每行结果都与内层查询结果进行比较 Question 12你需要把NEW_CUST表中的新客户信息导入CUST和CUST_SPECIAL表,如果客户信誉度大于10000,需要导入CUST_SPECIAL表,所有新客户信息都要导入CUST表,使用哪种技术可以尽快完成导入? A.外部表                B. MERGE 命令 C.INSERT多表插入命令   D.带有 WITH CHECK OPTION子句的INSERT命令 Question 13 分数表scores设计如下: courseID(课程编号) studentID(学生编号) score(分数) 另有一个学生信息表student,包含studentID,sname(学生姓名)。 已知并非所有学生都参加了courseID为0001的考试,现在查询所有参加0001号课程考试及格学生的学生姓名,下面正确的是()。A A. select sname from student where studentID in (select studentID from scores where courseID = 0001 and score>=60) B. select sname from student where studentID = (select studentID from scores where courseID = 0001 and score>=60) C. select sname from student where studentID not in (select studentID from scores where courseID = 0001 and score<=60) D. select sname from student where studentID exists (select studentID from scores where courseID = 0001 and score>=60) Question 14要依赖于抽象,不要依赖于具体。即针对接口编程,不要针对实现编程,是()的表述   A.开-闭原则   B.接口隔离原则   C.里氏代换原则   D.依赖倒转原则 Question 15“不要和陌生人说话” 是( )原则的通俗表述 A.接口隔离   B.里氏代换C.依赖倒转   D.迪米特:一个对象应对其他对象尽可能少的了解 Question 16对象适配器模式是( )原则的典型应用。    A.合成聚合复用原则   B.里式代换原则    C.依赖倒转原则      D.迪米特法则 二、简答题(每题5分)1、AOP和IOC的概念以及在spring中是如何应用的。2、简单描述hibernate持久化对象三种状态转换关系。3、spring的事务有几种方式?并描述spring事务的隔离级别和传播行为。4、简要阐述struts2的执行流程。 三、设计题某时装邮购提供商拟开发订单处理系统,用于处理客户通过电话、传真、邮件或Web站点所下订单。其主要功能如下:(1)增加客户记录。将新客户信息添加到客户文件,并分配一个客户号以备后续使用。(2)查询商品信息。接收客户提交商品信息请求,从商品文件中查询商品的价格和可订购数量等商品信息,返回给客户。(3)增加订单记录。根据客户的订购请求及该客户记录的相关信息,产生订单并添加到订单文件中。(4)产生配货单。根据订单记录产生配货单,并将配货单发送给仓库进行备货;备好货后,发送备货就绪通知。如果现货不足,则需向供应商订货。(5)准备发货单。从订单文件中获取订单记录,从客户文件中获取客户记录,并产生发货单。(6)发货。当收到仓库发送的备货就绪通知后,根据发货单给客户发货;产生装运单并发送给客户。(7)创建客户账单。根据订单文件中的订单记录和客户文件中的客户记录,产生并发送客户账单,同时更新商品文件中的商品数量和订单文件中的订单状态。(8)产生应收账户。根据客户记录和订单文件中的订单信息,产生并发送给财务部门应收账户报表。现采用结构化方法对订单处理系统进行分析与设计,完成以下两问题: 【问题 1】画出业务数据流程图 【问题 2】分析数据模型,画出相关ER图
页: [1]
查看完整版本: 【java笔试题】某金融公司java面试题 中级 珍藏