Skip to content

Commit 7f5a5d7

Browse files
author
Tanechka
committed
Lesson04 String
1 parent afc0cc5 commit 7f5a5d7

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
package ru.javawebinar.basejava;
2+
3+
public class MainString {
4+
public static void main(String[] args) {
5+
String[] strArray = new String[]{"1", "2", "3", "4", "5"};
6+
// String result = "";
7+
StringBuilder sb = new StringBuilder();
8+
for (String str : strArray) {
9+
sb.append(str).append(", ");
10+
}
11+
System.out.println(sb.toString());
12+
13+
String str1 = "abc";
14+
String str3 = "c";
15+
String str2 = ("ab" + str3).intern();
16+
System.out.println(str1 == str2);
17+
}
18+
}

0 commit comments

Comments
 (0)