We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ac34ca3 commit a91f3d9Copy full SHA for a91f3d9
SBDemo3.java
@@ -0,0 +1,16 @@
1
+// Demonstration of StringBuffer {insert, setCharAt, setLength}
2
+
3
+class SBDemo3{
4
+ public static void main(String args[]){
5
+ StringBuffer sb1 = new StringBuffer("My Java");
6
+ System.out.println("Adding the word : " + sb1.insert(3,"Core")); // My CoreJava
7
8
+ StringBuffer sb2 = new StringBuffer("Japan");
9
+ sb2.setCharAt(2,'k');
10
+ System.out.println("Changed character : " + sb2); // Jakan
11
12
+ StringBuffer sb3 = new StringBuffer("Computer");
13
+ sb3.setLength(4);
14
+ System.out.println("Cutting the length : " + sb3); // Comp
15
+ }
16
+}
0 commit comments