From 7cdb9c6d2d9d90e3ed4ee71a6a6049be53888f31 Mon Sep 17 00:00:00 2001 From: zeekling Date: Sun, 23 May 2021 18:48:56 +0800 Subject: [PATCH] StringBufferTest --- .../com/zeekling/string/StringBufferTest.java | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 src/main/java/com/zeekling/string/StringBufferTest.java diff --git a/src/main/java/com/zeekling/string/StringBufferTest.java b/src/main/java/com/zeekling/string/StringBufferTest.java new file mode 100644 index 0000000..f64a873 --- /dev/null +++ b/src/main/java/com/zeekling/string/StringBufferTest.java @@ -0,0 +1,26 @@ +package com.zeekling.string; + +/** + * @author zeekling + * @apiNote https://www.nowcoder.com/question/next?pid=30796423&qid=15076&tid=44509101 + * @since 2021-05-23 + */ +public class StringBufferTest { + + + public static void main(String[] args) { + + StringBuffer a = new StringBuffer("A"); + + StringBuffer b = new StringBuffer("B"); + + operate(a, b); + + System.out.println(a + "." + b); + } + + static void operate(StringBuffer x, StringBuffer y) { + x.append(y); + y = x; + } +}