相关代码 |
|
/* * 文件名:ex_6_2_1.java * 说 明:演示length()和capacity() */ class ex_6_2_1 { public static void main(String args[]) { StringBuffer sb = new StringBuffer("Hello"); System.out.println("buffer = " + sb); System.out.println("length = " + sb.length()); System.out.println("capacity = " + sb.capacity()); } }
相关资源 |
|