int cannot be dereferenced
807591Mar 9 2008 — edited Mar 9 2008Hi! I keep getting this "int cannot be dereferenced" error msg all the time... Can you help me correct my codes please??
import java.io.*;
import java.util.*;
public class Q4
{
public static void main(String [] args)
{
try
{
Scanner sf=new Scanner(new FileReader("Input.txt"));
int x=1;
while (x.hasNext())
{
x=sf.nextInt();
System.out.print(x + " ");
}
}
catch (IOException e)
{
System.out.println("Input error");
}
}
}
Thanks a lot...