Skip to content

Commit c899ca6

Browse files
authored
Create ConcatenateStrings.java
1 parent 18f63d2 commit c899ca6

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

strings/ConcatenateStrings.java

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
package com.zetcode;
2+
3+
public class ConcatenateStrings {
4+
5+
public static void main(String[] args) {
6+
7+
System.out.println("Return" + " of " + "the king.");
8+
System.out.println("Return".concat(" of ").concat("the king."));
9+
10+
StringBuilder sb = new StringBuilder();
11+
sb.append("Return");
12+
sb.append(" of ");
13+
sb.append("the king.");
14+
15+
System.out.println(sb);
16+
}
17+
}

0 commit comments

Comments
 (0)