package joeho.net.csdn.blog;
class TestInteger {
/**
* Method main
*
*
* @param args
*
*/
public static void main(String[] args) {
int w = new Integer(args[0]).intValue();
int h = Integer.parseInt(args[1]);
for(int i=0;i<h;i++)
{
StringBuffer strBuff = new StringBuffer();
for(int j=0;j<w;j++)
{
strBuff=strBuff.append('*');
}
/*比较下面两段代码的运行效率
*
StringBuffer strBuff = new StringBuffer();
for(int j=0;j<w;j++)
{
strBuff=strBuff.append('*');
}
*
*
*
String str = new String();
for(int j=0;j<w;j++)
{
str=str+*;
}
*
*
**/
System.out.println(strBuff.toString());
}
}
}
API 包装类的用法
最新推荐文章于 2022-04-02 23:57:41 发布