Ok I have a program that accepts input from a file. it reads in inputs and is supposed to close automagically when it sees the number '42'. Only problem, I can read the input just dont know how to look for 42.
Here's the code? HELP plz.
import java.io.* ;
public class life42 {
public static void main (String args[]) {
if (args.length == 1 )
{
try
{
FileInputStream fstream = new
FileInputStream(args[0]) ;
DataInputStream in =
new DataInputStream (fstream);
while (in.available() !=0)
System.out.println(in.readLine()) ;
}
in.close();
}
catch (Exception e)
{
System.err.println("There was an error reading your input");
}
System.out.println("Input read");
}}}