Помогите понять почему валидатор не принимает?!
в файле
результат
Решил так....
static {
try {
FileReader fileReaderreader = new FileReader(Statics.FILE_NAME);
BufferedReader bufferedReader = new BufferedReader(fileReaderreader);
String str = bufferedReader.readLine();
while (str != null){
lines.add(str);
str = bufferedReader.readLine();
}
}catch (FileNotFoundException e){
System.out.println("Файл не найден!");
}catch (IOException e){
}
}
package com.javarush.task.task15.task1525;
import java.io.*;
import java.util.ArrayList;
import java.util.List;
/*
Файл в статическом блоке
*/
public class Solution {
public static List<String> lines = new ArrayList<String>();
static {
int s;
try {
FileInputStream inputStream = new FileInputStream(Statics.FILE_NAME);
String str;
do{
str = "";
s = inputStream.read();
while (s != 13 && s != 10 && s != -1) {
str = str.concat(String.valueOf((char) s));
s = inputStream.read();
}
if(str != "") lines.add(str);
}while (s != -1);
}catch (FileNotFoundException e){
System.out.println("Файл не найден!");
}
catch (IOException e){
}
}
public static void main(String[] args) {
System.out.println(lines);
}
}