ReadItem help pls


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 4 of 4

Thread: ReadItem help pls

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

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


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center