You need to tell this to your teacher and to go at one pace at a time. I'll answer your questions though:
* Arrays are to group more than one value into a variable. Variable's are simply a reference to a value. Let's say you wanted to output a story multiple times, instead of "pasting" the story multiple times you can store the story in a variable and you'll simply only need to call the variable and it'll output the story:
story = "My Long Story here"
output(story) << this will output the sentence "My Long Story"
output(story)
output(story) << I can do this multiple times instead of having to paste the long story multiple times.
On with that, arrays are a way of storing multiple values in a variable.
array = new String[10] << we tell Java we want to make an a variable that has 10 values (arrays). So now we can do this:
array[0] = "Hi"
array[1] = "Hello"
array[2] = "Hey"
array[3] = "Hola!"
array[4] = "Hallo"
array[5] = "Bye"
array[6] = "Cya"
array[7] = "Goodbye"
array[8] = "Byebye"
array[9] = "Hiiiii"
Now we did tell Java we wanted 10 array values, and yes we used these 10 array values...but array value 1 starts at index 0. So we told Java we wanted array = new String[10] (10 array values in the variable array) but the first array value starts at 0, so array value 9 is in human terms value 10. Just accept the fact this is what is what, as there's no other reason why but that's how computers work.
Why would we want to use arrays? Let's say we wanted to use a different hello and goodbye greeting everyday, instead of needing 10 variables to hold each greeting, we just store them in arrays and we call them by there array index number, which like I said starts at 0. So, we can call the greeting "Hi" with:
array[0]
and "Hiiiii" with:
array[9] ... what we did above was simply assign the array values to greetings. Now we can use these greetings like above.
While loops: lets say you have a list of all your friends, and you had them in a document and you really couldn't be bothered to copy and paste them to output them on a Java application. Simple, while loops come to play. This is not a proper example, but its just to explain why you'd use while loops. Let's do a random example:
The good part in learning is testing, make a Java file and put this code in:
class Test {
public static void main(String[] args) {
while(int i = 1) {
System.out.println(1);
}
}
}
...save as test.java and compile the application (javac test.app then java test) - it'll continually print 1 on the screen, and it won't stop...since i is always equal to 1. This is just a quick example of while loops.