185k views
4 votes
The ____ method lets you add characters at a specific location within a StringBuilder object.

a.
append()

b.
charAt()

c.
insert()

d.
setCharAt()

1 Answer

0 votes

Answer:

insert()

Step-by-step explanation:

StringBuilder is a dynamic object which is used to create the string without any size restriction.

let discuss the option:

option a: append()

It is a function which is used to append the two string. but it not add the character at specific location.

option b: charAt()

it is function which is used to get the character at specific location.

option c: insert()

It is a function which is used to add the character at specific location, it takes two parameter location and character.

option d: setCharAt()

it is a function which is use to update the character at specific location.

Therefore, the correct option is c.

User Sanguine
by
6.0k points