-2
私はJavaに慣れていないので、Arraysに苦労しています。私は配列コードの助けが必要です。 20のエラーがありますが、私はそれらを見つけることができません(7を除く)。また、私はStackOverflowの新しいので、フォーマットのために申し訳ありません。 コードは次のとおりです。あなたは間違いなく基本を学ぶ必要がJava-アレイエラー
public clas ArrayProcessing
{
public void main (String [] args)
{
int iElement = 0,
int iSmallest = 0,
int iPossible = 0;
String strElements, strSmallest, strPossibles = "";
strElements = joptionPane.showInputDialog("How many elements would you like to be included in the array?");
iElements= Integer.parseInt(strElements);
strSmallest =joptionPane.showInputDialog("What would you like the smallest number in the array to be?");
iSmallest = Integer.parseInt(strSmallest);
strPossibles = joptionPane.showInputDialog("How many possible unique numbers would you like to have?");
iPossibleS= Integer.parseInt(strPossible);
int[] intArray = int[iElement];
displayArray(intArray[0]);
loadArray(intArray, iSmallest, iPossbles)
displayArray(intArray);
}
public static void loadArray(int intArray, int iSmallest, int iPossibles)
{
for (index =0; index < intArray.length(); index++)
{
intArray[index] = iSmallest + (int) (Math.random()* iPossibles);
}
}
public void displayArray(int[] intArray)
{
String strOutput="";
for (iCounter = 0, iCounter<intArray.length, iCounter++);
{
Output += intArray[iCounter] + "";
}
jOptionPane.showMessageDialog(null, "These are the values in your array: \n" + strOutput, "Arrays", JOptionPane.INFORMATION_MESSAGE);
}
http://stackoverflow.com/editing-help – azurefrog
インデントについて聞いたことがありますか?あなたが知っている、コードを読みやすくするというコンセプトはありますか? – Andreas
'intArray'は*配列*なので、おそらく' intArray'を 'loadArray'パラメータのint [] intArray'に変更すると助けになるでしょうか? ---最初の 'for'ループはパーツ間で'; 'を正しく使っているので、なぜ2番目に'、 'を使用しようとしていますか? – Andreas