I am writing a program in Java, it scans a file, counts lines, character, palindromes, words. My problem is when I ask for a filename, I am using BufferedReader and InputStreamReader to scan the file the user provided, and print the results in another file, my program compiles, when I type in the name of the file nothing happens, program does not finish, and remains stuck, here is code the BufferedReader, if the entire code is needed i will post it up
System.out.println("Enter the name of the file you would like to scan: ");
String fileName = scan.nextLine();
File file = new File(fileName);
BufferedReader br = new BufferedReader(newInputStreamReader(System.in));
You're creating an InputStreamReader object as System.in as the inputStream property. You'll need to specify a FileInputStream for as the InputStream.