Here is my code in question:
public File openInputFile(Scanner kb)
{
if(kb == null)
{
throw new RuntimeException("ERROR! Scanner Not Detected.");
}
System.out.print("Enter Name of File: ");
String fn = kb.nextLine();
File inf = FileUtil.openInputFile(fn);
return inf;
}
I am getting the following error:
FileUtil.java:33: error: non-static method openInputFile(String) cannot be referenced from a static context
File inf = FileUtil.openInputFile(fn);
^
Nothing is static, so I'm not sure why I'm getting this error. Can anyone help?