|
Issue with printing line
Hi, i am having problem trying to print out a line, eg i want to print out line number 13 it will then print that line. At the moment, my code won't compile, as i keep getting the error message "cannot find symbol - variable lines"
import java.util.*;
public class Goto extends Commands
{
Scanner keyboard = new Scanner(System.in);
public Goto(Editor editor)
{
super("goto", editor);
}
public void execute()
{
System.out.println("Line number: ");
currentLineNumber = Integer.parseInt(keyboard.nextLine());
System.out.println(currentLineNumber +":\t" + lines.get(currentLineNumber-1));
}
}
when i put in List<String> lines it works but when i run the app, it gives me all sort of error, can someone help
Thanks heapz
|