I'm new to Java too, so please take my advice lightly.
I think your variables need to be declared inside the main method
but I also noticed you declared them again inside the method and initialized them too. So basically you have two
String studentName variables. You can't have two with the same name.
As for loops, there's three choices: while, do while, and for loop. With any of these you'll need some kind of iterator variable to tell the loop when to stop running.