最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
Java字符串连接性能
时间:2008-04-28 编辑:简简单单 来源:一聚教程网
剑字有19种写法,Java中字符串连接也有好多种写法,比如要连接6个字符串,以下5种写法都是可以的,究竟哪种写法最简捷,哪种最高效呢。
public static String concat1(String s1, String s2, String s3, String s4, String s5, String s6) {
String result = "";
result += s1;
result += s2;
result += s3;
result += s4;
result += s5;
result += s6;
return result;
}
public static String concat2(String s1, String s2, String s3, String s4, String s5, String s6) {
StringBuffer result = new StringBuffer();
result.append(s1);
result.append(s2);
result.appen
<
-
上一个: java2html 用法
相关文章
- Java 字符串连接的性能问题分析 07-06
- java join字符串连接用法 05-09
- 在web.config中添加连接字符串 01-18
- SpringBoot测试配置属性与web启动环境解析 10-24
- vue中将el-switch值true、false改为number类型的1和0解析 10-24
- Vue中的路由配置项meta使用解读 10-24
热门栏目
-
php教程
php入门 php安全 php安装 php常用代码 php高级应用 -
asp.net教程
基础入门 .Net开发 C语言 VB.Net语言 WebService -
手机开发
安卓教程 ios7教程 Windows Phone Windows Mobile 手机常见问题 -
css教程
CSS入门 常用代码 经典案例 样式布局 高级应用 -
网页制作
设计基础 Dreamweaver Frontpage js教程 XNL/XSLT -
办公数码
word excel powerpoint 金山WPS 电脑新手 -
jsp教程
Application与Applet J2EE/EJB/服务器 J2ME开发 Java基础 Java技巧及代码