Results 1 to 2 of 2
  1. #1
    Azndaddy is offline Member
    Join Date
    Mar 2008
    Posts
    24
    Rep Power
    0

    Default 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

  2. #2
    new_2_java is offline Member
    Join Date
    Feb 2008
    Posts
    60
    Rep Power
    0

    Default

    "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.

Similar Threads

  1. Try Catch issue
    By curtis_fraser in forum Advanced Java
    Replies: 2
    Last Post: 12-14-2007, 12:04 AM
  2. Printing command line arguments
    By Java Tip in forum Java Tip
    Replies: 0
    Last Post: 12-03-2007, 10:27 AM
  3. Issue
    By chaitu444 in forum New To Java
    Replies: 2
    Last Post: 11-06-2007, 08:49 PM
  4. Reading in data from file line by line
    By bluekswing in forum New To Java
    Replies: 1
    Last Post: 10-02-2007, 01:19 AM
  5. compilation issue
    By orchid in forum Eclipse
    Replies: 2
    Last Post: 04-20-2007, 01:51 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •