0

Write an application that stores nine integers in an array. Display the integers from first to last ,and then vice versa

Java array

31st Jan 2023, 3:49 AM
Raymundo Vinze
Raymundo Vinze - avatar
4 Respostas
+ 6
Do you have a code that doesn't work? Please attach it from the code playground here.
31st Jan 2023, 3:55 AM
Ausgrindtube
Ausgrindtube - avatar
+ 4
Raymundo Vinze You can attach code from your Code Bits via the 'Insert Code' option when you post a question/answer. From your code text though, I can already spot a few syntax errors: 1. String, not Srting 2. length, not lenght 3. println() should end with `;`, not `=` 4. print(), not ptint 5. main function is missing closing brace `}` You'll have to fix these before attempting to work on the code logic itself.
31st Jan 2023, 5:08 AM
Mozzy
Mozzy - avatar
0
public class ArraysandArrayLists{ public static void main (Srting [] args){ int [] integers = new int[9]; //Initialize the value of an array for (int i = 0; i < integers.lenght;i++){ integers [i] = i+1; } //display the value of array for (int i = 0;i< integers.lenght;i++){ System.out.println("integers["+ i +"]")= System.out.ptint(integers [i] + "\n"); } }
31st Jan 2023, 4:03 AM
Raymundo Vinze
Raymundo Vinze - avatar
0
Ausgrindtube
31st Jan 2023, 4:28 AM
Raymundo Vinze
Raymundo Vinze - avatar