Java Forums

Main Menu
Home
Today's Posts
FAQ
Search
Contact Us

Java Network
Linux Archive
Java Tips
Java Tips Blog

Sponsored Links





Welcome to the Java Forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community, you will:

  • have access to post topics
  • communicate privately with other members (PM)
  • not see advertisements between posts
  • have the possibility to earn one of our surprises if you are an active member
  • access many other special features that will be introduced later.

Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 03-31-2008, 04:03 AM
Member
 
Join Date: Mar 2008
Posts: 24
Azndaddy is on a distinguished road
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
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 04-04-2008, 09:37 PM
Member
 
Join Date: Feb 2008
Posts: 45
new_2_java is on a distinguished road
"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.
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Try Catch issue curtis_fraser Advanced Java 2 12-14-2007 01:04 AM
Printing command line arguments Java Tip Java Tips 0 12-03-2007 11:27 AM
Issue chaitu444 New To Java 2 11-06-2007 09:49 PM
Reading in data from file line by line bluekswing New To Java 1 10-02-2007 02:19 AM
compilation issue orchid Eclipse 2 04-20-2007 02:51 AM


All times are GMT +3. The time now is 10:51 PM.


VBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org