Im trying to print an entire .txt file. I can only get the first line of the file to print. I think I need a while loop to get the entire file to print? From the examples Im finding on stack Im just getting confused. This is my code. How do I implement a while loop to print "file1"?
Thanks
fileByteStream = new FileInputStream("Folder/mytext.txt");
inFS = new Scanner(fileByteStream);
file1 = inFS.next();
System.out.println( file1 );