StringBuffer appendCodePoint(int codePoint)
描述 (Description)
java.lang.StringBuffer.appendCodePoint(int codePoint)方法将codePoint参数的字符串表示形式附加到此序列。 该参数附加到此序列的内容中。
声明 (Declaration)
以下是java.lang.StringBuffer.appendCodePoint()方法的声明
public StringBuffer appendCodePoint(int codePoint)
参数 (Parameters)
codePoint - 这是一个Unicode代码点。
返回值 (Return Value)
此方法返回对此对象的引用。
异常 (Exception)
NA
例子 (Example)
以下示例显示了java.lang.StringBuffer.appendCodePoint()方法的用法。
package com.iowiki;
import java.lang.*;
public class StringBufferDemo {
public static void main(String[] args) {
StringBuffer buff = new StringBuffer("tutorials");
System.out.println("buffer = " + buff);
// appends the CodePoint as string to the string buffer
buff.appendCodePoint(80);
// print the string buffer after appendingCodePoint 80
System.out.println("After appendCodePoint = " + buff);
}
}
让我们编译并运行上面的程序,这将产生以下结果 -
buffer = tutorials
After appendCodePoint = tutorialsP