さて、私は、このメソッドを使用して複数の配列を初期化しようとしていると述べたように、それは私に、このエラーを与える:任意のソリューションのjava-multilpe配列の初期化
int [] x,y,z=new int [10];
System.out.println("The first element of x:"+x[0]);
System.out.println("The second element of y:"+y[1]);
System.out.println("The third element of z:"+z[2]);`
とエラーは次のようになります。
ex1.java:47: error: variable x might not have been initialized
System.out.println("The first element of x:"+x[0]);
^
ex1.java:48: error: variable y might not have been initialized
System.out.println("The second element of y:"+y[1]);
^
2 errors
私は、エラーメッセージを含めることを意図していて、何らかの理由でそれを作成しなかったとし、質問を編集することを含めると仮定します。 –
はい、正しいです。私はエラーメッセージ – heartySteam