StringBuffer appendCodePoint() Method in Java with Examples
The java.lang.StringBuffer.appendCodePoint(int cp)is the method which appends the string representation of the codePoint argument to this sequence.
Attention reader! Don’t stop learning now. Get hold of all the important Java Foundation and Collections concepts with the Fundamentals of Java and Java Collections Course at a student-friendly price and become industry ready. To complete your preparation from learning a language to DS Algo and many more, please refer Complete Interview Preparation Course.
public StringBuffer appendCodePoint(int cp)
Parameters : The method accepts a single parameter cp of integer type and refers to the Unicode code point.
Return Value : The method returns this object after appending the string represented by the codepoint.
Input: StringBuffer = Apple int cp = 65 Output: AppleA Input: StringBuffer = GeeksforGeeks int cp = 156 Output: GeeksforGeeks? Explanation: Because 65 is the ASCII value for 'A' and 156 is the ASCII value for '?'
Below programs illustrate the java.lang.StringBuffer.appendCodePoint(int cp) method:
String buffer = Geeksforgeeks After appending CodePoint is = GeeksforgeeksA
String buffer = Geeksforgeeks After appending CodePoint is = Geeksforgeeks6
String buffer = Geeksforgeeks After appending CodePoint is = Geeksforgeeks+