2011-11-27 26 views
0

此代碼將拋出ArrayStoreException。不知道這是錯的。使用toArray時ArrayStoreException

hm = new HighscoreManager();    
hm.addScore(Game.timePerWord);  
String[] converted = new String[hm.scores.size()]; 
converted = hm.scores.toArray(new String[0]); 
+0

HighscoreManager.scores是什麼類型的? – Craigy

+0

哪一行引發異常?最後一個? –

+0

HighscoreManager.scores是一個字符串,最後一行引發異常。 – AnTz

回答