我想創建一個新的String [] []數組,但日食給我一個錯誤:分配雙字符串數組
public class CurriculumVitae {
String[][] education = new String[2][6]; //throws error here and expects "{" but why?
education[0][0] = "10/2012 − heute";
education[0][1] = "Studium der Informatik";
education[0][2] = "Johannes Gutenberg−Universit \\」at Mainz";
education[0][3] = "";
education[0][4] = "";
education[0][5] = "";
education[1][0] = "10/2005 − 5/2012";
education[1][1] = "Abitur";
education[1][2] = "Muppet-Gymnasium";
education[1][3] = "Note: 1,3";
education[1][4] = "";
education[1][5] = "";}
是什麼錯誤訊息? – tod
「令牌上的語法錯誤」;「,{expected before the token」 – Tak3r07
初始化值必須定義這種類型的數據結構(數組)因此,應該使用構造函數。 – TeachMeJava