This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
Class java.util.Scanner would indeed be suitable for this. Have a look at the documentation for it and see if there are some methods you can use. Also have a look at the documentation for class ArrayList.
You can find a link to the API documentation in by signature below.