Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
7 つの整数をインクリメントする一連の if/else-if/else ステートメントを、コレクション内の適切な整数をインクリメントする 1 つのステートメントに置き換える必要があります。初期化された整数の配列があります:
int[] finals={0, 0, 0, 0, 0, 0, 0};
リスト内のさまざまな変数のインデックスにアクセスして変更する方法がわかりません。これは Java BTW です。
配列内の変数にアクセスするには:
int[] finals={1,2,3,4,5,6,7};
finals[0] = 1; finals[1] = 2;