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"
public class Goto extends Commands
Scanner keyboard = new Scanner(System.in);
public Goto(Editor 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
"cannot find symbol - variable lines" means that you are using a variable which has not been declared, and the compiler can't find its declaration.