标题:[讨论]一道104题(知道什么是104吧)
只看楼主
wxhwjsw
Rank: 1
等 级:新手上路
帖 子:274
专家分:0
注 册:2006-6-15
 问题点数:0 回复次数:2 
[讨论]一道104题(知道什么是104吧)

98. Given:

13. public class Test {
14. public static void main (String [] args) {
15. StringBuffer a = new StringBuffer (“A”);
16. StringBuffer b = new StringBuffer (“B”);
17. operate (a,b);
18. system.out.printIn{a + “,” +b};
19. )
20. static void operate (StringBuffer x, StringBuffer y) {
21. y.append (x);
22. y = x;
23. )
24. }

What is the result?

A.The code compiles and prints “A,B”.
B.The code compiles and prints “A, BA”.
C.The code compiles and prints “AB, B”.
D.The code compiles and prints “AB, AB”.
E.The code compiles and prints “BA, BA”.
F.The code does not compile because “+” cannot be overloaded for stringBuffer.

[此贴子已经被作者于2006-8-10 11:16:37编辑过]

搜索更多相关主题的帖子: operate public result 
2006-08-10 11:15
NiceGirl
Rank: 2
等 级:新手上路
威 望:4
帖 子:909
专家分:0
注 册:2006-6-18
得分:0 

13. public class Test {
14. public static void main (String [] args) {
15. StringBuffer a = new StringBuffer (“A”);
16. StringBuffer b = new StringBuffer (“B”);
17. operate (a,b);
18. system.out.printIn{a + “,” +b};
19. )
20. static void operate (StringBuffer x, StringBuffer y) {
21. y.append (x);
22. y = x;
23. )
24. }


曾经以为百般艰难,蓦然回首,才发现已飞渡千山。。!
2006-08-10 14:27
wxhwjsw
Rank: 1
等 级:新手上路
帖 子:274
专家分:0
注 册:2006-6-15
得分:0 
楼上什么意思啊.........

一个人的快乐,不是因为他拥有的多,而是因为他计较的少.
2006-08-10 15:54



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-83188-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.600556 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved