第一部分:选择题
question no: 1
1、public class test {
public static void changestr(string str){
str="welcome";
}
public static void main(string[] args) {
string str="1234";
changestr(str);
system.out.println(str);
}
}
please write the output result :
question no:2
1. public class test {
2. static boolean foo(char c) {
3. system.out.print(c);
4. return true;
5. }
6. public static void main( string[] argv ) {
7. int i =0;
8. for ( foo(’a’); foo(’b’)&&(i<2); foo(’c’)){
9. i++ ;
10. foo(’d’);
12. }
13. }
14. }
what is the result?
a. abdcbdcb
b. abcdabcd
c. compilation fails.
d. an exception is thrown at runtime.
question no: 3
1. class a {
2. protected int method1(int a, int b) { return 0; }
3. }
which two are valid in a class that extends class a? (choose two)
a. public int method1(int a, int b) { return 0; }
b. private int method1(int a, int b) { return 0; }
c. private int method1(int a, long b) { return 0; }
d. public short method1(int a, int b) { return 0; }
e. static protected int method1(int a, int b) { return 0; }
question no: 4
1. public class outer{
2. public void someoutermethod() {
3. // line 3
4. }
5. public class inner{}
6. public static void main( string[]argv ) {
7. outer o = new outer();
8. // line 8
9. }
10. }
which instantiates an instance of inner?
a. new inner(); // at line 3
b. new inner(); // at line 8
c. new o.inner(); // at line 8
d. new outer.inner(); // at line 8//new outer().new inner()
question no: 5
which method is used by a servlet to place its session id in a url that is written to the servlet’s response output stream?
a. the encodeurl method of the httpservletrequest interface.
b. the encodeurl method of the httpservletresponse interface.
c. the rewriteurl method of the httpservletrequest interface.
d. the rewriteurl method of the httpservletresponse interface.
question no: 6
which two are equivalent? (choose two)
a. <%= yoshibean.size%>
b. <%= yoshibean.getsize()%>
c. <%= yoshibean.getproperty("size")%>
question no: 7
which of the following statements regarding the lifecycle of a session bean are correct?
1. java.lang.illegalstateexception is thrown if sessioncontext.getejbobject() is invoked when a stateful session bean instance is passivated.
2. sessioncontext.getrollbackonly() does not throw an exception when a session bean with bean-managed transaction demarcation is activated.
3. an exception is not thrown when sessioncontext.getusertransaction() is called in the afterbegin method of a bean with container-managed transactions.
4. jndi access to java:comp/env is permitted in all the sessionsynchronization methods of a stateful session bean with container-managed transaction demarcation.
5. accessing resource managers in the sessionsynchronization.afterbegin method of a stateful session bean with bean-managed transaction does not throw an exception.
第二部分:概念题
1. 描述struts体系结构?对应各个部分的开发工作主要包括哪些?
2. xml包括哪些解释技术,区别是什么?
3. jsp有哪些内置对象和动作?它们的作用分别是什么?
4、sql问答题
select * from table
和
select * from table
where name like ’%%’ and addr like ’%%’
and (1_addr like ’%%’ or 2_addr like ’%%’
or 3_addr like ’%%’ or 4_addr like ’%%’ )
的检索结果为何不同?
5、sql问答题
表结构:
1、 表名:g_cardapply
字段(字段名/类型/长度):
g_applyno varchar 8;//申请单号(关键字)
g_applydate bigint 8;//申请日期
g_state varchar 2;//申请状态
2、 表名:g_cardapplydetail
字段(字段名/类型/长度):
g_applyno varchar 8;//申请单号(关键字)
g_name varchar 30;//申请人姓名
g_idcard varchar 18;//申请人身份证号
g_state varchar 2;//申请状态
其中,两个表的关联字段为申请单号。
题目:
1、 查询身份证号码为440401430103082的申请日期
2、 查询同一个身份证号码有两条以上记录的身份证号码及记录个数
3、 将身份证号码为440401430103082的记录在两个表中的申请状态均改为07
4、 删除g_cardapplydetail表中所有姓李的记录
责任编辑:小草