| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 548 人关注过本帖
标题:[讨论]一道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
快速回复:[讨论]一道104题(知道什么是104吧)
数据加载中...
 
   



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

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