為什么必須加 .length 是什么意思?
?String[] hobbys = { "sports", "game", "movie" };
??System.out.println("循環(huán)輸出數(shù)組中元素的值:");
??for(int i=0;i<hobbys.length;i++){
??? System.out.println(hobbys[i]);
??}
?String[] hobbys = { "sports", "game", "movie" };
??System.out.println("循環(huán)輸出數(shù)組中元素的值:");
??for(int i=0;i<hobbys.length;i++){
??? System.out.println(hobbys[i]);
??}
2017-07-08
舉報(bào)
2017-07-08