Want to become a Vibe Coder? Join Vibe Coding Training here
x
C# Corner
Tech
News
Videos
Forums
Jobs
Books
Events
More
Interviews
Live
Learn
Training
Career
Members
Blogs
Challenges
Certification
Contribute
Article
Blog
Video
Ebook
Interview Question
Collapse
Feed
Dashboard
Wallet
Learn
Achievements
Network
Refer
Rewards
SharpGPT
Premium
Contribute
Article
Blog
Video
Ebook
Interview Question
Register
Login
Java Append and Insert Program
WhatsApp
Alagunila Meganathan
Jul 28
2016
643
0
0
import
java.lang.*;
public
class
AppendInsert{
public
static
void
main(String[] args) {
System.out.println(
"StringBuffer insert and append example!"
);
StringBuffer sb =
new
StringBuffer(
0
);
//First position
System.out.println(sb.insert(
0
,
"Raj"
));
int
len = sb.length();
//last position
System.out.println(sb.insert(len,
"Deepak"
));
//Six position
System.out.println(sb.insert(
6
,
"kumar"
));
//Always last
System.out.println(sb.append(
"Mohit"
));
}
}
Java Append
Java Insert
StringBuffer
Up Next
Java Append and Insert Program