public class IntStringBuffer {
public static void main(String[] args) {
int value=10;
StringBuffer sb=new StringBuffer(String.valueOf(value));
System.out.println(sb);
}
}
已成功运行...调试没问题....
先把INT转化为STRING 然后 new StringBuffer(str//这就是要的那个字符串);
最简单的
int i = 1;
StringBuffer s = new StringBuffer(i+"");
如下:
int a;
StringBuffer sb=new StringBuffer(String.valueOf(a));
new StringBuffer(int转换的String)