Ok, so java code help and things here. I will try to help with any questions I can with basic java.  

First, loops. 

If loop: if(initialisition; loop conditions; increment/decrement) {
(commands to be done);
}

This checks the loop before it does any code, so can be exected 0 times.

for(condition) {
(commands to be done);
}

Does basically the same as the if loop, but one must declare the variable they use in the condition outside the loop, and increment in the commands to be done.
 
The while loop 
while...
Continue reading ...