已封装该功能:(只需要在main方法当中调用该功能,传入字符串和字符即可)
public static void indexOfcharTimes(String str,char ch){
int num = 0;
for(int i = 0 ; i < str.length(); i++){
if(str.charAt(i) == ch){
num++;
}
}
sys("字符"+ ch + "出现的次数:" + num);
}
public static void indexOfcharTimes(String str,char ch){
int num = 0;
for(int i = 0 ; i < str.length(); i++){
if(str.charAt(i) == ch){
num++;
}
}
sys("字符"+ ch + "出现的次数:" + num);
}
2017-08-16
public class HelloWorld {
public static void main(String[] args) {
double a = 91.5;
Double b = new Double(a);
Double c =a;
System.out.println("装箱后的结果为:" + b + "和" + c);
Double d = new Double(87.0);
double e = d.doubleValue();
double f =d;
public static void main(String[] args) {
double a = 91.5;
Double b = new Double(a);
Double c =a;
System.out.println("装箱后的结果为:" + b + "和" + c);
Double d = new Double(87.0);
double e = d.doubleValue();
double f =d;
2017-08-16
List<Integer> list = new ArrayList<>();
这样也没毛病~
这样也没毛病~
2017-08-16
感觉这节前面都在讲些没用的,也不明确提到哪里用了set对象,就得自己慢慢找,慢慢猜,周围同学普遍反映第三季质量变差
2017-08-16
三季都学完了,自己在要求的基础上,加入了一点新的东西,可以自定义玩家的人数,利用了老师还没哟有讲过的正则表达式,自己加入了详细的注释,希望大家多指教,谢谢
http://www.imooc.com/article/19923
http://www.imooc.com/article/19923
2017-08-16
服了简直,好几节内容提交老是系统繁忙,刷新,重新打开都不行,对于这种强迫症看见任务没有100%难受,什么系统啊
2017-08-16
String suffix = fileName.substring(index);
if(index != -1 && index != 0 && suffix.equals(".java")){
sys("此文件名符合要求");
boolean flag = index03 > index02;
if(index02 != -1 && flag)
public static void sys(String ste){
System.out.println(ste);
}
}
if(index != -1 && index != 0 && suffix.equals(".java")){
sys("此文件名符合要求");
boolean flag = index03 > index02;
if(index02 != -1 && flag)
public static void sys(String ste){
System.out.println(ste);
}
}
2017-08-16
常见的ArrayList、HashSet、HashMap(HashMap使用键值对(<key,value>));
不常见的LinkedList;
不常见的LinkedList;
2017-08-15
public void testForEach(){
list.forEach((cr3) -> {
System.out.println("添加的课程:" + cr3.getId() + "添加的课程名:" + cr3.getName());
});
}
list.forEach((cr3) -> {
System.out.println("添加的课程:" + cr3.getId() + "添加的课程名:" + cr3.getName());
});
}
2017-08-15