StringBuffer sb1="";
String s1=sb1.toString();toString
public String toString()
Converts to a string representing the data in this string buffer. A new String object is allocated and initialized to contain the character sequence currently represented by this string buffer. This String is then returned. Subsequent changes to the string buffer do not affect the contents of the String.
Implementation advice: This method can be coded so as to create a new String object without allocating new memory to hold a copy of the character sequence. Instead, the string can share the memory used by the string buffer. Any subsequent operation that alters the content or capacity of the string buffer must then make a copy of the internal buffer at that time. This strategy is effective for reducing the amount of memory allocated by a string concatenation operation when it is implemented using a string buffer.Overrides:
toString in class Object
Returns:
a string representation of the string buffer
String s1=sb1.toString();toString
public String toString()
Converts to a string representing the data in this string buffer. A new String object is allocated and initialized to contain the character sequence currently represented by this string buffer. This String is then returned. Subsequent changes to the string buffer do not affect the contents of the String.
Implementation advice: This method can be coded so as to create a new String object without allocating new memory to hold a copy of the character sequence. Instead, the string can share the memory used by the string buffer. Any subsequent operation that alters the content or capacity of the string buffer must then make a copy of the internal buffer at that time. This strategy is effective for reducing the amount of memory allocated by a string concatenation operation when it is implemented using a string buffer.Overrides:
toString in class Object
Returns:
a string representation of the string buffer
解决方案 »
- 请问输入网址后,如何将该页面自动的生成缩略图
- 关于图片img裁剪的一个问题
- 求服务器端直接获取客户端IP地址
- 谁给我个分页代码呀
- freemarker 不在web.xml中配置,如何实现页面的展示
- 请问高手,Oracle和domino数据库怎么进行数据交换?谢谢。
- 请问谁有 JAVA数据库编程实例 的随书源代码 清华大学出版社出的
- 高分求采用JSP+MYSQL技术的网站的设计文档
- 字段值显示的问题????
- jdbc2.0是否支持连接池?连接池如何测试?
- 如何写Statemen语句让Connection产生的ResultSet支持first方法?
- 急:各位救命!!!!!!!!(一个关于类型转换问题)
Converts to a string representing the data in this string buffer.