I am using jdk1.8.0_121 on eclipse kepler (my OS is Windows 7), I created a simple project containing one class with a static main method.
When I tried to create a list by following
List l = Arrays.asList(1,2);
I got this error:
The asList (T []) method in an array of type is not applicable to arguments (int, int).
If someone encounters a similar problem, I found that I had this error because I imported edu.emory.mathcs.backport.java.util.Arrays; instead java.util.Arrays;
edu.emory.mathcs.backport.java.util.Arrays;
java.util.Arrays;
, asList. : int [] data = {1,2,3,4,5}; List = Arrays.asList();
import arrays from java.util.Arrays;
Source: https://habr.com/ru/post/1674558/More articles:Saving Notebook table format when knitting - rAndroid-анимация recyclerview - androidTensorflow collects matrix columns very slowly - tensorflowActivity activity in Android activity will not work properly on overlapping views - androidHow to check if a key exists in a Json Object and get its value - javaDetecting missing file names in a folder - powershellPassing a table as input to dapper in dotnet core - .net-coreDatatable class in asp.net core - c #shortcut to run the current Python unit test in VSCode - pythonHow to create a custom UIButton with image and text? - iosAll Articles