0

I'm wondering if there is a simple one liner that would unbox an array of Doubles into an array of doubles.

Obviously it could be done simply using a for loop, but I'm just curious to see if Java has some fancy auto-unboxing feature that allows the conversion without explicitly writing a for loop.

NateW
  • 908
  • 1
  • 8
  • 28
  • 2
    common-langs has `double[] d = ArrayUtils.toPrimitive(doubles);` Please search before posting. Java 8: `Stream.of(doubles).mapToDouble(Double::doubleValue).toArray()` – Ruan Mendes May 12 '16 at 17:54
  • Oops. I did search and was pretty surprised I didn't come up with something. I guess I just didn't find the right key words. Thank you! – NateW May 12 '16 at 18:11

0 Answers0