求助?。。。?!
public class HelloWorld { ? ?public static void main(String[] args) { String [] hobbys=new String [2]; String[] hobbys = { "sports", "game", "movie" }; System.out.println("循環(huán)輸出數(shù)組中元素的值:"); for(int i=0;i<=hobbys.length;i++){ System.out.println(hobbys[i]);} } } 這是什么問題?運(yùn)行總是出錯(cuò)
2018-03-31
把String[] hobbys = new String[2];刪了就行~