杭州天丽科技有限公司 JAVA高级程序员笔试题
来源:互联网 发布:视频素材软件 编辑:程序博客网 时间:2024/04/29 12:19
http://www.mianwww.com/html/2013/04/18345.html
选择题
1:1. What will be the result of executing the following code?
2. boolean a = true;
3. boolean b = false;
4. boolean c = true;
5. if (a == true)
6. if (b == true)
7. if (c == true) System.out.println("Some things are true in this world");
8. else System.out.println("Nothing is true in this world!");
9. else if (a && (b = c)) System.out.println("It's too confusing to tell what is true and what is false");
10. else System.out.println("Hey this won't compile");
12. Choices:
A.The code won't compile
B."Some things are true in this world" will be printed
C."Hey this won't compile" will be printed
D.None of these
2: Which of the following statements are true?
A.The automatic garbage collection of the JVM prevents programs from ever running out of memory
B.A program can suggest that garbage collection be performed and force it
C.Garbage collection is platform independent
D.An object becomes eligible for garbage collection when all references denoting it are set to null.
3:
1. What will happen when you attempt to compile and run the following code?
2.
3. class Base
4.
5. {
6.
7. int i = 99;
8.
9. public void amethod()
10.
11. {
12.
13. System.out.println("Base.amethod()");
14.
15. }
16.
17. Base()
18.
19. {
20.
21. amethod();
22.
23. }
24.
25. }
26.
27. public class Derived extends Base
28.
29. {
30.
31. int i = -1;
32.
33.
34.
35. public static void main(String argv[])
36.
37. {
38.
39. Base b = new Derived();
40.
41. System.out.println(b.i);
42.
43. b.amethod();
44.
45. }
46.
47. public void amethod()
48.
49. {
50.
51. System.out.println("Derived.amethod()");
52.
53. }
54.
55. }
56.
57. Choices:
A.Derived.amethod() -1 Derived.amethod()
B.Derived.amethod() 99
C.Compile time error
D.Derived.amethod()
4:A class design requires that a member variable should be accessible only by same package, which modifer word should be used?
A.protected
B.public
C.no modifer
D.private
5:假定a和b为int型变量,则执行下述语句组后,b的值为
a=1;
b=10;
do
{
b-=a;
a++;
} while (b--<0);
A.9
B.-2
C.-1
D.8
6:
1. What results from attempting to compile and run the following code?
2.
3. public class Ternary
4.
5. {
6.
7. public static void main(String args[])
8.
9. {
10.
11. int a = 5;
12.
13. System.out.println("Value is - " + ((a < 5) ? 9.9 : 9));
14.
15. }
16.
17. }
18.
19. Choices:
A.prints: Value is - 9
B.Compilation error
C. prints: Value is - 5
D.None of these
7:
1. String s=”Example String”;Which operation is not legal?
A.int i=s.length();
B.s[3]=”x”;
C.String short_s=s.trim();
D.String t=”root”+s;
8: Consider the class hierarchy shown below:
--------------------------------------------------------------------
class FourWheeler implements DrivingUtilities
class Car extends FourWheeler
class Truck extends FourWheeler
class Bus extends FourWheeler
class Crane extends FourWheeler
----------------------------------------------------------------------
Consider the following code below:
1.DrivingUtilities du;
2.FourWheeler fw;
3.Truck myTruck = new Truck();
4.du = (DrivingUtilities)myTruck;
5.fw = new Crane();
6.fw = du;
Which of the statements below are true?
Choices:
A.Line 4 will not compile because an interface cannot refer to an object.
B.The code will compile and run.
C.The code will not compile without an explicit cast at line 6, because going down the hierarchy without casting is not allowed.
D.The code will compile if we put an explicit cast at line 6 but will throw an exception at runtime.
9:
1. Give the following java class:
2. public class Example{
3. static int x[]=new int[15];
4. public static void main(String args[]){
5. System.out.println(x[5]);
6. }
7. }
8. Which statement is corrected?
A.When compile, some error will occur.
B.When run, some error will occur.
C.Output is zero.
D.Output is null.
10:
1. Give the code fragment:
2. if(x>4){
3. System.out.println(“Test 1”);}
4. else if (x>9){
5. System.out.println(“Test 2”);}
6. else {
7. System.out.println(“Test 3”);}
8. Which range of value x would produce of output “Test 2”?
A.x<4
B.x>4
C.x>9
D.None
11:Use the operator “>>” and “>>>”. Which statement is true?
A.1010 0000 0000 0000 0000 0000 0000 0000 >> 4 give 0000 1010 0000 0000 0000 0000 0000 0000
B.1010 0000 0000 0000 0000 0000 0000 0000 >> 4 give 1111 1010 0000 0000 0000 0000 0000 0000
C.1010 0000 0000 0000 0000 0000 0000 0000 >>> 4 give 0000 0000 0000 0000 0000 0000 0000 0000
D.1010 0000 0000 0000 0000 0000 0000 0000 >>> 4 give 1111 1010 0000 0000 0000 0000 0000 0000
12:使用 JDBC 可以做到的是
A.把二进制代码传送到任何关系数据库中
B.把 Java 源代码传送到任何关系数据库中
C.把表单信息传送到任何关系数据库中
D.很容易地把 SQL 语句传送到任何关系数据库中
13:Math.round(-11.5)等於多少?
A.-11
B.-12
C.-11.5
D.none
14:软件生命周期的瀑布模型把软件项目分为3个阶段、8个子阶段,以下哪一个是正常的开发顺序?
A.计划阶段、开发阶段、运行阶段
B.设计阶段、开发阶段、编码阶段
C.设计阶段、编码阶段、维护阶段
D.计划阶段、编码阶段、测试阶段
简答题
15:找到一个子字符串,优化速度,优化空间。
16:什么是接口?为什么要定义接口?接口与抽象类有何异同?
17:下面的代码在绝大部分时间内都运行得很正常,请问在什么情况下会出现问题?问题的根源在哪里?
import java.util.LinkedList;
public class Stack {
LinkedList list = new LinkedList();
public synchronized void push(Object x) {
synchronized(list) {
list.addLast( x );
notify();
}
}
public synchronized Object pop()
throws Exception {
synchronized(list) {
if( list.size() <= 0 ) {
wait();
}
return list.removeLast();
}
}
}
18:Java的接口和C++的虚类的相同和不同处。
19:hibernate中load()/get()区别。
20:How do you use JMX to monitor the cluster? if you have used。
21:Java中异常处理有什么优点?
22:tomcat中用来编译JSP页面的是哪个类,或者哪个模块?
23:Class.forName的作用?为什么要用?
24:jsp有哪些动作?作用分别是什么?
25:写一个程序,把一个100以内的自然数分解因数。(自然数分解因数就是将一个自然数分解为几个素数的乘积,提示,由于该数不是很大,所以可以将质数保存在数组中,以加快计算速度)
- 杭州天丽科技有限公司 JAVA高级程序员笔试题
- iOS笔试题之杭州卓健科技有限公司
- 转载(工信部)李丹丹 杭州天宽科技有限公司
- 杭州康王环保科技有限公司
- 亚信联创杭州分公司笔试题——java工程师
- 华三(杭州) ------笔试题
- 2017,从杭州玛马吉科技有限公司出走之后
- 网易笔试题 2012.10.10(杭州)
- 杭州某单位笔试大题
- 杭州某互联网公司校招笔试Java选做题
- 2009年校园招聘笔试题-杭州(2)
- 2009年校园招聘笔试题-杭州(1)
- 微策略MicroStrategy校园招聘笔试题2013.10.16杭州
- 小米2014校园招聘笔试题2013.10.19杭州
- 腾讯2014校园招聘2013.10.26杭州笔试题
- 网易2014校园招聘2013.10.10杭州笔试题
- 改有道笔试题 —— 杭州小记 二
- 杭州校招android笔试题(持续更新)
- oracle 用户、角色管理,授权!
- 多线程服务器的适用场合
- android系统如何自适应屏幕大小
- hadoop 版本问题
- HDOJ 2391 Filthy Rich dp动态规划.....so easy......
- 杭州天丽科技有限公司 JAVA高级程序员笔试题
- 百度地图API学习总结
- Objective-C中的id 类型
- linux 正则表达式
- MYSQL服务无法启动1067解决办法
- 做网站经常会用到的特效代码网址
- 不能为虚拟电脑开一个新任务. No error info. 返回 代码:E_FAIL (0x80004005) 组件:ProgressProxy 界面:IProgre
- 成为伟大开发者的“九步曲”
- gReader 将死,8款 Google Reader 替代品