DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

+ Reply to Thread
Results 1 to 4 of 4
  1. #1
    Join Date
    Sep 2005
    Posts
    3

    ReadItem help pls

    hey, I am unable to use the ReadItem method, along with .getNumber and .getLine, etc., but it gives me an error saying "cannot find symbol".
    I have used some code I know is correct and I did not write myself and the same error persists. Any help would be greatly appreciated.

    thank you

  2. #2
    Join Date
    Mar 2004
    Posts
    635
    We cant help you with methods from a class that we dont know. Some code would help us.

  3. #3
    Join Date
    Sep 2005
    Posts
    3
    this program is supposed to read in a first and last name and the print out the first letter of the name followed by the last name, i.e.
    john doe > j. doe

    as you can tell im new to java so if im not making something clear just tell me


    public class Pgm04 {

    public static void main (String[] args) {

    String aName;

    // Read in the name
    System.out.print ("Enter a name as first last: ");
    aName = ReadItem.getLine();

    // Process output
    System.out.println (aName.charAt(0) + ". " + aName.substring(aName.indexOf(' ') + 1));
    }
    }

  4. #4
    Join Date
    Aug 2005
    Posts
    17
    The error is in the following line:

    Code:
    aName = ReadItem.getLine();
    It appears that the object called 'ReadItem' is not defined. You have to create it first. Here is an example (it might not work b/c I don't know what type of object ReadItem is):

    Code:
    PUT_TYPE_HERE ReadItem = new PUT_TYPE_HERE();
    Replace PUT_TYPE_HERE with the actual type of 'ReadItem'

    Hope this helps.

    For more help, www.NeedProgrammingHelp.com

Similar Threads

  1. Replies: 0
    Last Post: 01-10-2002, 01:43 AM
  2. thread problem....pls help
    By Satish in forum Java
    Replies: 0
    Last Post: 11-29-2001, 09:07 AM
  3. class path problems pls help
    By sunil in forum Java
    Replies: 1
    Last Post: 06-13-2001, 09:03 AM
  4. PLS CHECK THE CODE
    By SATISH in forum Java
    Replies: 1
    Last Post: 08-30-2000, 12:37 PM
  5. Replies: 1
    Last Post: 08-20-2000, 01:53 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


Top DevX Stories

Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL


Sponsored Links