類String對象中的內容一旦被初始化就不能再改變
類StringBuffer類用於封裝內容可以改變的字符串
用toString方法轉換成String類型
String x=new StringBuffer().append("a").append(4).app("c").toString
String x="a"+4+"c"
String類的方法
構造方法:
String()
equalslgnoreCase方法 相當於equals忽略大小寫
indexOf(inn ch)字符所在的位置 "Hello Word".indexOf("o"); 4
public class Integer
{
public static void main(String[] args)
{
int w = new Integer(args[0].inValue());
int h = Integer.parseInt(args[1]);
// int h = Integer.valueOf(args[1]).inValue();
for(int i=0;i<h;i++)
{
StringBuffer sb = new StringBuffer();
for(int j=0;j<w;j++)
{
sb.append("*");
}
System.out.println(sb);
}
}
}