已采纳回答 / 慕移动7265888
ListTest中 的某某.add 这里的某某指的是 集合 例如 coursesToSelect.add(...) SetTest中的 某某.某某.add 这里指的是 第一个某某指的是对象 ,第二个某某指的是 对象中的集合 例如 student. courses.add(.....); 为什么第二个要这样呢 因为courses集合没有在SetTest里面声明 ,而是在Student类中被声明定义,故要在SetTest类中使用,就通过用实例的对象 student 然后 . 引用该集合 cour...
2018-01-23
https://www.imooc.com/article/22901
别拦着我,我要装逼,哈哈哈哈哈哈哈哈啊哈哈
别拦着我,我要装逼,哈哈哈哈哈哈哈哈啊哈哈
2018-01-22
for(int i=3;str.length()-i>=0;){
str.insert(str.length()-i,",");
i=i+4;
}
str.insert(str.length()-i,",");
i=i+4;
}
2018-01-22
// 获取文件的后缀
String prefix = fileName.substring(index+1);
这样也行,不过这节的确BUG满满,哈哈
String prefix = fileName.substring(index+1);
这样也行,不过这节的确BUG满满,哈哈
2018-01-22
顺序应该是try->catch->finally,即便try或者catch中有return,系统也会自动寻找是否包含finally,如果finally中有return,则终止方法,不会执行try和catch中的return,如果finally中没有return,则执行catch和try中的return。另外最好不要使用return和throw,否则可能出现一些很奇怪的情况————疯狂JAVA讲义。
2018-01-22
老师教知识不可能面面俱到,大部分还是要靠自己,建议大家都买一本疯狂JAVA讲义,先看视频再看书,然后再大量练习。想靠视频就学会是不现实的,最终还是要码代码。老师没讲到的你想到了说明你乐于思考,不会就去问,没有怪老师不跟你讲清楚的道理,师傅领进门,修行在个人。
2018-01-22
①这个例子抛出异常后 System.out.println("执行"); 不会执行
public static void main(String[] args)throws Exception {
String str = null ;
int strLength = 0;
strLength = str.length();
System.out.println(strLength);
System.out.println("执行");
}
public static void main(String[] args)throws Exception {
String str = null ;
int strLength = 0;
strLength = str.length();
System.out.println(strLength);
System.out.println("执行");
}
2018-01-22