File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 22 * @由于个人水平有限, 难免有些错误, 还请指点:
33 * @Author: cpu_code
44 * @Date: 2020-07-12 12:03:11
5- * @LastEditTime: 2020-09-16 13:06:48
5+ * @LastEditTime: 2020-09-16 13:16:12
66 * @FilePath: \java\README.md
77 * @Gitee: [https://gitee.com/cpu_code](https://gitee.com/cpu_code)
88 * @Github: [https://github.com/CPU-Code](https://github.com/CPU-Code)
@@ -236,6 +236,8 @@ java编程基础 面向对象 javaAPI 集合 IO GUI JD8C 多线程 网络编程
236236
237237- [x] [ stringBuilder1__ 字符串拼接] ( javaAPI/stringBuilder/stringBuilder1.java )
238238- [x] [ stringBuilder2__ 构造方法] ( javaAPI/stringBuilder/stringBuilder2.java )
239+ - [x] [ stringBuilder3__ append] ( javaAPI/stringBuilder/stringBuilder3.java )
240+
239241
240242### [ 包装类] ( javaAPI/stringBuilder )
241243
Original file line number Diff line number Diff line change 1+ /*
2+ * @由于个人水平有限, 难免有些错误, 还请指点:
3+ * @Author: cpu_code
4+ * @Date: 2020-09-16 13:15:39
5+ * @LastEditTime: 2020-09-16 13:16:04
6+ * @FilePath: \java\javaAPI\stringBuilder\stringBuilder3.java
7+ * @Gitee: [https://gitee.com/cpu_code](https://gitee.com/cpu_code)
8+ * @Github: [https://github.com/CPU-Code](https://github.com/CPU-Code)
9+ * @CSDN: [https://blog.csdn.net/qq_44226094](https://blog.csdn.net/qq_44226094)
10+ * @Gitbook: [https://923992029.gitbook.io/cpucode/](https://923992029.gitbook.io/cpucode/)
11+ */
12+ package javaAPI .stringBuilder ;
13+
14+ public class stringBuilder3 {
15+ public static void main (String [] args ) {
16+ StringBuilder builder = new StringBuilder ();
17+
18+ StringBuilder builder2 = builder .append ("cpucode" );
19+
20+ System .out .println ("builder :" + builder );
21+ System .out .println ("builder2 :" + builder2 );
22+ System .out .println (builder == builder2 );
23+
24+ builder .append ("cpu" );
25+ builder .append ("hello" );
26+ builder .append (true );
27+ builder .append (100 );
28+
29+ builder .append ("hello" ).append ("world" ).append (true ).append (100 );
30+ System .out .println ("builder:" +builder );
31+ }
32+ }
33+
34+ /*
35+ builder :cpucode
36+ builder2 :cpucode
37+ true
38+ builder:cpucodecpuhellotrue100helloworldtrue100
39+ */
You can’t perform that action at this time.
0 commit comments