I want to convert letters in array to a list by addAll(); and asList(); methods but java seems to complain. I am not sure if the error is located where the arrow is pointed. How to solve it?
import java.util.* {
public static void main(String[] args) {
List<String> abcs = new ArrayList<>();
slowa.add("a");
slowa.add("b");
slowa.add("c");
System.out.println(abcs);
String[] ne = new String[]{"d","e","f","g"}; //<--------
List<String> convert = Arrays.asList(ne);
Collections.addAll(abcs, ne);//to,from
System.out.println(abcs);
}
}
I get the following error: error