知道美河 | 上传资料 | VIP申请 | 精品课程 | 资料搜索 | 问题反馈 | 会员手册 | 积分消费 | 积分充值 | 帐号保护
美河学习学习在线赞助VIP

美河学习在线(主站) eimhe.com

 找回密码
 建立账号
查看: 10472|回复: 4

[求助] 谁能把这些题做一下

[复制链接]
发表于 2007-2-6 16:10:39 | 显示全部楼层 |阅读模式
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 :welcome

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")%>
D. <jsp:getProperty id="YoshiBean" param="size"/>
E. <jsp:getProperty name="YoshiBean" param="size"/>
F. <jsp:getProperty id="YoshiBean" property="size"/>
G. <jsp:getProperty name="YoshiBean" property="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.
发表于 2007-2-6 17:02:38 | 显示全部楼层
1.welcome 形参和实参的问题。
2.A   for循环中间部分只要为true就可以继续。
3。BE 这道题不好意思的用Eclipse试验了一下。 D虽然也不对但是原因不是由于继承的问题而是类型错误。
4.A 内部类 看成类中的一个函数。B错。可以用o.new Inner();
5.A
6。BG
7 这个实在不知......
发表于 2007-2-6 17:29:50 | 显示全部楼层
3 AC,adamed 题目没看好 B方法重写,但级别降低不允许,E static出错,Dreturn int
发表于 2007-2-6 19:32:13 | 显示全部楼层
居然把单词看错了。天啊。。。。。
我可怜的4级词汇啊。。。。。。。
发表于 2007-2-10 16:15:45 | 显示全部楼层
您需要登录后才可以回帖 登录 | 建立账号

本版积分规则

 
QQ在线咨询

QQ|小黑屋|手机版|Archiver|美河学习在线 ( 浙网备33020302000026号 )

GMT+8, 2025-5-7 15:31

Powered by Discuz!

© 2001-2025 eimhe.com.

快速回复 返回顶部 返回列表