Новый курс! Каждый программист должен знать генеративный ИИ!
Попробуйте бесплатный урок0
Write an application that stores nine integers in an array. Display the integers from first to last ,and then vice versa
Java array
4 ответов
+ 6
Do you have a code that doesn't work?
Please attach it from the code playground here.
+ 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.
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");
}
}
0
Ausgrindtube