Results 1 to 2 of 2
Thread: Issue with printing line
- 03-31-2008, 02:03 AM #1
Member
- Join Date
- Mar 2008
- Posts
- 24
- Rep Power
- 0
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
- 04-04-2008, 07:37 PM #2
Member
- Join Date
- Feb 2008
- Posts
- 60
- Rep Power
- 0
Similar Threads
-
Try Catch issue
By curtis_fraser in forum Advanced JavaReplies: 2Last Post: 12-13-2007, 11:04 PM -
Printing command line arguments
By Java Tip in forum Java TipReplies: 0Last Post: 12-03-2007, 09:27 AM -
Issue
By chaitu444 in forum New To JavaReplies: 2Last Post: 11-06-2007, 07:49 PM -
Reading in data from file line by line
By bluekswing in forum New To JavaReplies: 1Last Post: 10-02-2007, 12:19 AM -
compilation issue
By orchid in forum EclipseReplies: 2Last Post: 04-20-2007, 12:51 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks