TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
C# Corner
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Java Append and Insert Program
Alagunila Meganathan
Jul 28
2016
Code
595
0
0
facebook
twitter
linkedIn
Reddit
WhatsApp
Email
Bookmark
expand
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