I tried the method posted below but still no success. I get an error of cannot find symbol. How else can i modify the code below. Do i have to place the line in the bottom?
import java.util.Scanner;
import java.io.*;
import java.util.Arrays;
/**
* Write a description of class lab8 here.
*
* @author (your name)
* @version (a version number or a date)
*/
public class lab8
{
public static void main(String[] args) throws IOException
{
FileInputStream fileIn = new FileInputStream("haikuFun.txt");
Scanner scrn = new Scanner(fileIn);
String[] lines = fileIn.readAllLines(new File("haikuFun.txt").toPath());
while(scrn.hasNext()) {
String s = scrn.nextLine();
System.out.println(s);
}
}
}