I have a code that seems to run fine, but when I submit it the program is picking up on a null pointer exception in line 14. I only have a understanding of what the means, so any explanation or help would be greatly appreciated.
private Scanner input;
public RemoteTux()
{
IOHelper.createScannerForURL(
"http://courses.cs.vt.edu/~cs1114/Fall2012/tux-commands.txt");
}
public RemoteTux(Scanner scanner)
{
this();
input = scanner;
}
public void act()
{
if (input.hasNext())
{
String command = (String)input.next();
if ("left".equals(command))
{
left();
}
else if ("right".equals(command))
{
right();
}
else if ("forward".equals(command))
{
forward();
}
}
}
