public class ListFile {
public static void main(String[] args){
String[] arr = {"text", "tekl"};
List<String> list = Arrays.asList(arr);
List<String> listt = Arrays.asList({"text", "tttt"});
}
}
Line 4 is totally working fine. However, line 5 gives error: "Syntax error on token ".", @ expected after this token" at column 36.
Is the argument passed as {"text", "tttt"}
is considered as block here?