by Dinesh Thakur Category: array

void setCharAt (int index, char ch) : This method sets the character at the specified index in the string buffer to the new character ch. For example, s1. setCharAt (6, 'J') will return Hello Java.

public class StringBuffersetCharAt

{
        public static void main(String[] args)
     {
            StringBuffer sl = new StringBuffer("Hello java");
            sl.setCharAt(6,'J');
            System.out.println("sl.setCharAt(6,'J') : " + sl);        
      }
}

StringBuffer setCharAt() Java Example

About Dinesh Thakur

Dinesh ThakurDinesh Thakur holds an B.SC (Computer Science), MCSE, MCDBA, CCNA, CCNP, A+, SCJP certifications. Dinesh authors the hugely popular blog. Where he writes how-to guides around Computer fundamental , computer software, Computer programming, and web apps. For any type of query or something that you think is missing, please feel free to Contact us.



Search Content







Popular Article