Mar 17, 2025
interestRates
containing four doubles.interestRates
points to a memory address storing the doubles.interestRates
yields a memory address, not values.for
.interestRates
) on the right of the colon.double
) and declare a temporary variable (e.g., rate
).System.out.println(rate)
to print each element.interestRates
, printing each rate (2.9, 3.5, 4.8, 6.7) sequentially.colors
with rainbow colors.colors
on the right, String
and currentColor
on the left.System.out.println(currentColor)
.currentColor.charAt(0)
to print the first character of each color.rate = rate + 0.03
does not update the interestRates
array.
rate
), not the original array.