老师其实讲得很不错啦!主要就是挑一些典型方法的使用讲解给大家。然而师傅领进门,修行靠个人。自学能力是一个程序员必不可少的,如果讲到这个程度了还认为老师讲得不够详细...那我觉得你可以考虑另寻出路了
2017-07-16
两大接口:Collection(集合)和Map(映射关系)
继承了Collection的接口:List Queue Set
ArrayList实现了List LinkedList实现了List和Queue HashSet实现了Set
继承了Collection的接口:List Queue Set
ArrayList实现了List LinkedList实现了List和Queue HashSet实现了Set
2017-07-15
int[] nums = new int[10];
//通过循环给数组赋值
for (int i = 0; i < nums.length; i++) {
// 产生10以内的随机数
int x = (int)(Math.random()*10);
nums[i] = x;// 为元素赋值
}
// 使用foreach循环输出数组中的元素
for ( int num : nums ) {
System.out.print(num + " ");
}
//通过循环给数组赋值
for (int i = 0; i < nums.length; i++) {
// 产生10以内的随机数
int x = (int)(Math.random()*10);
nums[i] = x;// 为元素赋值
}
// 使用foreach循环输出数组中的元素
for ( int num : nums ) {
System.out.print(num + " ");
}
2017-07-15
// 从后往前每隔三位插入逗号
for(int i = 0; i <= str.length()/4; i++){
str.insert(str.length()-4*i, ',');
}
for(int i = 0; i <= str.length()/4; i++){
str.insert(str.length()-4*i, ',');
}
2017-07-15
将prefix的位置改为index+1,就不用考虑".java",直接写"java"
2017-07-14
@睿智狂人 ,2015-12-27发表的那条评论有错误。
String str1 = "abc"; 这条语句中创建的对象“abc”存放在常量池中,而不是栈中。str1(即对象"abc"的引用)存放于栈中。
常量池中的数据是可以共享的,String str2 = "abc" ,此时先搜索常量池中是否有“abc”,
已经存在,所以不会再次创建,这就是常量池的数据共享。
栈中的数据不能共享。
String str1 = "abc"; 这条语句中创建的对象“abc”存放在常量池中,而不是栈中。str1(即对象"abc"的引用)存放于栈中。
常量池中的数据是可以共享的,String str2 = "abc" ,此时先搜索常量池中是否有“abc”,
已经存在,所以不会再次创建,这就是常量池的数据共享。
栈中的数据不能共享。
2017-07-14