setcharat() in java

setCharAt() StringBuffer Example

To manipulate string, java.lang.StringBuffer class comes with many methods, otherwise, which will take long laborious coding as in C/C++. One such method is setCharAt(int, char) that replaces a single character in the string buffer. Now read setCharAt() StringBuffer. What Java API says of setCharAt() StringBuffer: public synchronized void setCharAt(int index1,…