📄 j_capacity.java
字号:
// ////////////////////////////////////////////////////////
//
// J_Capacity.java
// ////////////////////////////////////////////////////////
public class J_Capacity
{
public static void main(String args[])
{
StringBuffer b=new StringBuffer( );
System.out.println("The length is " + b.length( ) + ", and the capacity is " + b.capacity( ));
b.ensureCapacity(18);
System.out.println("The length is " + b.length( ) + ", and the capacity is " + b.capacity( ));
b=new StringBuffer("1234");
System.out.println("The length is " + b.length( ) + ", and the capacity is " + b.capacity( ));
b.ensureCapacity(60);
System.out.println("The length is " + b.length( ) + ", and the capacity is " + b.capacity( ));
} // End of method: main
} // End of class: J_Capacity
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -