为啥写成(1+“” "小明")
给后来者:等你学到下一节,就会明白老师的用意.
下一节中要实现向Student类型的List中添加1000以内随机的id,这时怎么写?
总不能syso("random.nextInt()","小明");吧
相比之下,syso(random.nextInt() +"","小明");直接将int类型的id转换为String类型的,方便很多(相比于新建变量)
给后来者:等你学到下一节,就会明白老师的用意.
下一节中要实现向Student类型的List中添加1000以内随机的id,这时怎么写?
总不能syso("random.nextInt()","小明");吧
相比之下,syso(random.nextInt() +"","小明");直接将int类型的id转换为String类型的,方便很多(相比于新建变量)
2017-02-09
public class HelloWorld {
public static void main(String[] args) {StringBuilder str =new StringBuilder();str.append("jaewkjldfxmopzdm");int count=1;for(int i=str.length()-1;i>=0;i--){
if(count%3==0) {
str.insert(i,','); }
count++;
System.out.print(str.toString());
}
}
public static void main(String[] args) {StringBuilder str =new StringBuilder();str.append("jaewkjldfxmopzdm");int count=1;for(int i=str.length()-1;i>=0;i--){
if(count%3==0) {
str.insert(i,','); }
count++;
System.out.print(str.toString());
}
}
2017-02-09
16行 String index = fileName.substring(fileName.length()-5,fileName.length()-4);
19行 String prefix =fileName.substring(fileName.length()-4, fileName.length());
22行 if (index.equals(".")&&prefix.equals("java"))
36行 int index2 = fileName.indexOf("@");
19行 String prefix =fileName.substring(fileName.length()-4, fileName.length());
22行 if (index.equals(".")&&prefix.equals("java"))
36行 int index2 = fileName.indexOf("@");
2017-02-08