Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

208
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar

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 Denunciar

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda