java.util.Scanner
is probably what you’re looking for. As for the for loop, you should google Java for loop
and read up on how they work. Then combine the two concepts.
solved How to iterate a for loop for a user input amount of times Java [closed]