Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

216
Visualizações
The method asList(T[]) in the type Arrays is not applicable for the arguments (int, int)

I am using jdk1.8.0_121 on eclipse kepler (My OS is windows 7), I have created a simple project contained one class with static main method.

When I tried to create a list as follow

List l = Arrays.asList(1,2);

I got this error :

The method asList(T[]) in the type Arrays is not applicable for the arguments (int, int).

over 4 years ago · Santiago Trujillo
3 Respostas
Responde à pergunta

0

In case anyone else comes across a similar issue, I found that I had this error because I was importing edu.emory.mathcs.backport.java.util.Arrays; instead of java.util.Arrays;

over 4 years ago · Santiago Trujillo Relatório

0

I have faced same issue like wrongly imported org.javers.common.collection.arrays So removed that one and imported from Utils Arrays got

over 4 years ago · Santiago Trujillo Relatório

0

I think you need to put an array as the parameter of asList. like:

int[] data = {1,2,3,4,5};
List list = Arrays.asList(data);
over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda