It has error on the second for in the array Alltext - in the error it says that it can't find the symbol of Alltext and my code can't seem to initialize because of that.
I have tried placing the second for inside the first for it didn't work. I even tried to change some way like making key code for the String array.
for (int i = 1; i <= n; i++) {
System.out.print("Input number : ");
a = Masuk.readLine();
n = Integer.parseInt(a);
System.out.print("Input Text : ");
a = Masuk.readLine();
String[] Alltext = {a+" "+n};
}
for (String i : Alltext) {
System.out.println(i);
}
I'm expecting the output is when i'm inputting the number and text it will show all of it in the Alltext array.
Alltextshould beallText.