You could then easily print this directly... But is your program just about this? Will not you need to re-use these contents for other purposes? If so, you should store them somewhere... An easy solution would be the use of an ArrayList... http://java.sun.com/j2se/1.4.2/docs/api/java/util/ArrayList.html
You should focus on the constructor, add and get methods...
- read file using Scanner
- Store contents in ArrayList
- print ArrayList