Answer
System.out.print("Enter the name of the directory:");
File a= new File((new BufferedReader(new
InputStreamReader(System.in))) .readLine());
File[] b=a.listFiles();
for(int i=1;i < b.length;i++){
fn=b[i].getPath(); }
Problem
System.out.print("Enter the name of file: ");
fn = (new BufferedReader(new InputStreamReader(System.in)))
.readLine();
I have tried
File[] file Array=new File(System.in).listFiles();
for(File f: fileArray) // loop through all files {
if(f.getName().endsWith(".fasta")){
fn = (new BufferedReader(new InputStreamReader(fileArray)).readLine()); // to read the files }}`
but receive an error of The constructor File(InputStream) is undefined
I want to change fn to a directory. How do I iterate through the directory keeping the Buffered Reader and InputStreamReader?