C 、 line 10 D 、 line 14 E 、 line 15
21 、已知如下类定义: class Base { public Base (){ //... } public Base ( int m ){ //... } public void fun( int n ){ //... } }
public class Child extends Base{ // member methods
}
如下哪句可以正确地加入子类中? ( A 、 private void fun( int n ){ //...} B 、 void fun ( int n ){ //... }
C 、 protected void fun ( int n ) { //... } D 、 public void fun ( int n ) { //... }
22 在如下源代码文件 Test.java 中 , A 、 public class test { public int x = 0; public test(int x) { this.x = x; }
}
B 、 public class Test{ public int x=0; public Test(int x) { this.x = x;
} }
C 、 public class Test extends T1, T2 { public int x = 0; public Test (int x) { this.x = x; }
}
D、 protected class Test extends T2{ public int x=0; public Test(int x){ this.x=x;
)
哪个是正确的类定义?(
)
}
}
23 、public class Foo{
public static void main(String sgf[]){ StringBuffer a = new StringBuffer(\ StringBuffer b = new StringBuffer(\ operate(a,b);
System.out.println(a+\ }
static void operate(StringBuffer x,StringBuffer y){ x.append(y); y=x;
} }
运行结果是什么?
A.The code compiles and prints “A.B”. B.The code compiles and prints “A.A”. C.The code compiles and prints “B.B”. D.The code compiles and prints “AB.B”.
E.The code compiles and prints “AB.AB”.
24、列论述HTTP协议中doGet和doPost方法的命题中,哪2个是正确的( )
A. doGet适用大量数据传输
B. doPost适用大量数据传输
C. 默认情况下doPost将Form中参数和值显示在URL中 D. 默认情况下doGet将Form中参数和值显示在URL中
25 .JDBC statement 中如果要预编译,使用那个方法 ( A.statement
B.callablestatement
C.prepareStatement
26. 释放SessionBean使用的某些资源或者刷新Entity Bean的缓存的代码一般实现在哪个方法中?
ejbRemove ejbStore ejbActivate ejbPassivate ejbLoad
27. PL/SQL中事务控制的语句(多选) (
)
A. COMMIT B.ROLLBACK C.SAVEPOINT D.SET TRANSACTION
28. GET和POST是两个主要的HTTP Method,为了在Servlet中获取到变量a的值,下面哪
)
个报文是正确的?
A 、GET / HTTP/1.1 Host: www.google.com Content-Length: 15 a=b&b=c&c=d&d=e B、 POST /?a=b HTTP/1.1 Host: www.google.com Content-Length: 0
C、POST / HTTP/1.1 Host: www.google.com Content-Length: 15 Content-Type: application/x-www-form-urlencoded a=b&b=c&c=d&d=e
D、 GET /?a=b HTTP/1.1 Host: www.google.com
29、 执行以下语句出错的行是:( ) SELECT deptno,max(sal) FROM emp
WHERE job IN ('CLERK','SALEMAN','ANALYST') GROUP BY deptno
HAVING sal>1500;
A、 第二行 B、 第三行 C、 第一行 D、 第四行
30、关于MVC,下面说法正确的是:( ) A. Servlet实现MVC的Model部分 B. JSP实现MVC的Control部分 C. EJB实现MVC的Model部分 D. HTTP实现MVC的View部分
二、简答题(请自选3题作答)
1、说出ArrayList,Vector, LinkedList的存储性能和特性
2、什么是java序列化,如何实现java序列化?
3、java中有几种类型的流?JDK为每种类型的流提供了一些抽象类以供继承,请说出他们分
别是哪些类?
4、java中有几种方法可以实现一个线程?用什么关键字修饰同步方法? stop()和suspend()方法为何不推荐使用?
5、EJB规范规定EJB中禁止的操作有哪些?
相关推荐: