Languages
[Edit]
PT

Java - converter double [] para List <Double> - matriz dupla primitiva para lista de objetos

1 points
Created by:
Alyona
1170

DescriĆ§Ć£o do Problema:

1. Melhor soluĆ§Ć£o - DoubleStream.of (Java 8)

Edit

Resultado:

2. DoubleStream.of + retornar a ArrayList (Java 8)

Edit

Retornar a implementaĆ§Ć£o necessĆ”ria, por exemplo ArrayList ou HashSet

Resultado:

3. IteraĆ§Ć£o explĆ­cita sobre a matriz (antes do Java 8)

Edit

Resultado:

4. Doubles.asList (Guava)

Edit

Resultado:

5. ArrayUtils.toObject (Apache commons lang3)

Edit

Resultado:

Resumo - em java podemos converter double [] em List <Double> por:

Edit
  1. Melhor soluĆ§Ć£o - DoubleStream.of (Java 8)
  2. DoubleStream.of + retornar a ArrayList (Java 8)
  3. IteraĆ§Ć£o explĆ­cita sobre a matriz (before Java 8)
  4. Doubles.asList (Guava)
  5. ArrayUtils.toObject (Apache commons lang3)

ReferĆŖncias:

Edit
  1. DoubleStream.of - Java 8 docs
  2. Doubles.asList - Guava docs
  3. ArrayUtils.toObject - Apache commons lang3 docs
1
Donate to Dirask
Our content is created by volunteers - like Wikipedia. If you think, the things we do are good, donate us. Thanks!
Join to our subscribers to be up to date with content, news and offers.
Native Advertising
šŸš€
Get your tech brand or product in front of software developers.
For more information Contact us
Dirask - we help you to
solve coding problems.
Ask question.

ā¤ļøšŸ’» šŸ™‚

Join