Постоянно пишет: Невозможно привести объект типа "try-with-resources not applicable to variable type (java.util.List<java.lang.String>" к типу "variable type (java.util.List<java.lang.String> cannot be converted to java.lang.AutoCloseable)".
package com.javarush.task.pro.task15.task1506;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.List;
import java.util.Scanner;
/*
Фейсконтроль
*/
public class Solution {
public static void main(String[] args) {
//напишите тут ваш код
try(Scanner console = new Scanner(System.in);
var file = Files.readAllLines(Paths.get(console.nextLine()))) {
char[] buffer0 = new char[65536];
List<char> buffer = new ArrayList<char>(as.List(buffer0));
while(file.ready()) {
int real = file.read(buffer0);
}
for(char symbol : buffer) {
if (symbol != '.' && symbol != ',' && symbol != ' ') {
System.out.println(symbol);
}
}
}
catch(Exception e) {
e.printStackTrace();
}
}
}