Declare an ArrayList named taxRates of five elements of type Double and initialize the elements (starting with the first) to the values 0.10, 0.15, 0.21 , 0.28, 0.31, respectively.
LANGUAGE: JAVA
CHALLENGE:
Declare an ArrayList named taxRates of five elements of type Double and initialize the elements (starting with the first) to the values 0.10, 0.15, 0.21 , 0.28, 0.31, respectively.
SOLUTION:
ArrayList<Double> taxRates = new ArrayList<Double>(Arrays.asList(0.10, 0.15, 0.21, 0.28, 0.31));