How to read a text file into an arraylist in JAVA?
<p>I need help on a part of my JAVA program HW. I don't understand how to read a file into an array list. please help thanks!</p>

<p>getBreadInfo - reads bread.txt into an array list (containing bread
name, $, and price) and then assigns to an array breadInfo[], then
return this array for SandwichApp to display bread menu.</p>

<p>getBread - is similar to getBreadInfo, except it only contains the
bread name, and return another array bread[] for SandwichApp to figure
out which bread the user selected because user type in a number
associate with the bread (index+1), rather than bread name.</p>

<p>getMapBreadPrice - is similar to the above two, except it returns a
hash map containing pair values for bread name (key) and price (value)
for SandwichApp to figure out what is the price for the bread user
selected.</p>

<p>and the bread.txt file reads</p>

<p>White Bread~1.50</p>

<p>Wheat Bread~1.80</p>

<p>French Bread~2.00</p>

<p>Organic Bread~2.30</p>
