已封裝該功能:(只需要在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.xianlaiwan.cn/article/19923
http://www.xianlaiwan.cn/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