The program displays exactly what is written in the used .txt file (One line of text) but the validation says " The program displays too few lines". I tried System.out.println as well...
Anyone knows whats wrong?
Thanks in advance :)
package com.codegym.task.task13.task1318;
import java.io.*;
import java.util.Scanner;
/*
Reading a file
*/
public class Solution {
public static void main(String[] args) throws IOException {
BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
String dataname = reader.readLine();
InputStream inStream = new FileInputStream(dataname);
BufferedReader reader1 = new BufferedReader(new InputStreamReader(inStream));
while(inStream.available() > 0 ){
System.out.println(reader1.readLine());
}
inStream.close();
reader.close();
reader1.close();
}
}