Hi
I have no idea why this code cannot pass the 2nd condition. It displays everything from a file, but validator still shows "The program displays too few lines."
can anyone help?
thx
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));
try{
System.out.println("Podaj nazwę pliku");
String fileName = reader.readLine();
FileInputStream inStream = new FileInputStream("C:/Users/pawel" +
"/Desktop/" + fileName + ".txt");
while(inStream.available() > 0){
int text = inStream.read();
System.out.print((char)text);
}
inStream.close();
} catch (Exception e){
System.out.print(e);
}
reader.close();
}
}