Java开发网 Java开发网
注册 | 登录 | 帮助 | 搜索 | 排行榜 | 发帖统计  

您没有登录

» Java开发网 » Java SE 综合讨论区 » 学习心得/方法/资源  

按打印兼容模式打印这个话题 打印话题    把这个话题寄给朋友 寄给朋友    该主题的所有更新都将Email到你的邮箱 订阅主题
flat modethreaded modego to previous topicgo to next topicgo to back
作者 Re:coding 注意事项 [Re:ysheng]
ftang



版主


发贴: 214
积分: 38
于 2005-12-09 23:37 user profilesend a private message to usersearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
ysheng wrote:
使用 StringBuffer 也需要注意效率

很多时候我们习惯这样用
sbf.append("a line"+"\r\n");

但下面这样用要减少一半的时间,虽然代码增加了1行
sbf.append("a line");
sbf.append("\r\n");


you didn't get the point here:
"a" + "b" + "c" is bad expierence because in memory JVM will create

"a", "b", "ab","c", "abc" which here, "ab" is a waste...so you should always use StringBuffer.

Get the point...know why...ALL the tips here are Computer Sciense 101, but you guys should know why....WHY!! not only know HOW




CJSDNer6月14日北京聚会花絮

话题树型展开
人气 标题 作者 字数 发贴时间
17869 coding 注意事项 ysheng 151 2005-12-09 11:10
15802 Re:coding 注意事项 liuliu1231111 46 2005-12-09 12:32
15834 Re:coding 注意事项 liuliu1231111 77 2005-12-09 12:38
15544 Re:coding 注意事项 ysheng 140 2005-12-09 16:42
15314 Re:coding 注意事项 why 498 2005-12-09 19:02
15460 Re:coding 注意事项 ysheng 77 2005-12-09 23:21
16428 Re:coding 注意事项 ftang 520 2005-12-09 23:37
16072 Re:coding 注意事项 ranchgirl 1091 2005-12-15 17:23
15435 Re:coding 注意事项 ftang 502 2005-12-16 03:50
15434 Re:coding 注意事项 ranchgirl 657 2005-12-16 03:54
15413 Re:coding 注意事项 zzw109433 128 2005-12-14 10:55
15627 Re:coding 注意事项 zcjl 276 2005-12-14 12:03
15482 Re:coding 注意事项 scarecrow 239 2005-12-15 13:00
15865 Re:coding 注意事项 zcjl 208 2005-12-15 15:53
15263 Re:coding 注意事项 ranchgirl 213 2005-12-15 17:43
15424 Re:coding 注意事项 scarecrow 269 2005-12-15 18:03
15969 Re:coding 注意事项 scarecrow 312 2005-12-16 10:04
15382 Re:coding 注意事项 javadd 195 2005-12-15 14:00
15516 Re:coding 注意事项 ftang 147 2005-12-16 03:59

flat modethreaded modego to previous topicgo to next topicgo to back
  已读帖子
  新的帖子
  被删除的帖子
Jump to the top of page

   Powered by Jute Powerful Forum® Version Jute 1.5.6 Ent
Copyright © 2002-2021 Cjsdn Team. All Righits Reserved. 闽ICP备05005120号-1
客服电话 18559299278    客服信箱 714923@qq.com    客服QQ 714923