Its working but not validate, i seen the solution and its quite different from mine,but the output should be the same. im just wondering if my version it's legal and correct even if its not validate.
Please let me know if there are some important mistake.
package com.codegym.task.task15.task1525;
import java.io.*;
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
/*
File in a static block
*/
public class Solution extends Statics{
public static List<String> lines = new ArrayList<>();
public static void main(String[] args) throws FileNotFoundException {
System.out.println(lines);
InputStream inStream = new FileInputStream(FILE_NAME);
Scanner scanner = new Scanner(inStream);
while (scanner.hasNext()){
String s = scanner.next();
lines.add(s);
}
//System.out.println(lines);
scanner.close();
}
}