String[] hobbys = { "sports", "game", "movie" };
System.out.println("循环输出数组中元素的值:");
for(int i=0;i<hobbys.length;i++){
System.out.println("数组中的第"+(i+1)+"个元素为:"+hobbys[i]);
}
}
System.out.println("循环输出数组中元素的值:");
for(int i=0;i<hobbys.length;i++){
System.out.println("数组中的第"+(i+1)+"个元素为:"+hobbys[i]);
}
}
2014-11-30