forked from jvm-coder/Java_Programs
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstringUsage.java
More file actions
33 lines (17 loc) · 462 Bytes
/
stringUsage.java
File metadata and controls
33 lines (17 loc) · 462 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import java.io.*;
import java.util.*;
class stringUsage {
public static void main(String[] args)
{
String gfg[] = { "Are", "You", "A", "Programmer" };
StringBuilder obj = new StringBuilder();
obj.append(gfg[0]);
obj.append(" " + gfg[1]);
obj.append(" " + gfg[2]);
obj.append(" " + gfg[3]);
String str = obj.toString();
System.out.println(
"Single string generated using toString() method is --> "
+ str);
}
}