Strange error message - linked lists (again)

I have to keep at this linked list thing if I'm ever going to really understand it!!
I have created a method to create a linked list via user input. I'm receiving only one strange ERROR, which states:
"This method must return a result of of type ListADT.Node."
And I have just started building my class ListADT...
class ListADT{
public Node createList(int aNumber){     // THIS IS WHERE THE ERROR POINTS
      * integer variable aNumber is the length of the list user wishes to create.
     Scanner console = new Scanner(System.in);
     int number;                    // declare variable number as an integer.
     Node newNode = new Node();          // declare and initialize newNode.
     Node first = new Node();          // declare and initialize first.
     Node last = new Node();               // delcare and initizlize last.
     try
          for(int i = 0; i <= aNumber; i++){               // for loop to enter numbers to build list.
          System.out.println("Please enter an integer: ");     // prompt user.
          number = console.nextInt();                    // assign user input to variable number.
          newNode.info = number;          // assign number to newNode;
          if(first == null){               // checks to see if Node first is a null value.
               first = newNode;          // if true, then this node is the first and last node in the list.
               last = newNode;
          else{                              // if first is not null, then newNode is placed at the end of the list.
               last.link = newNode;
               last = newNode;
          return first;
     catch (InputMismatchException imeRef)     //Catches non-integer values
          System.out.println("You entered a non-Integer! " + imeRef.toString());     //Prints error message

Now why can't the error messages help
out a little more? I would have never guessed that
there was a problem with the catch block not
returning anything!!The message was pretty informative -- it told you what was wrong. If the compiler could be so smart as to be able to tell you exactly what to fix, then the compiler would be able to write code all by itself -- and then you'd be out of a job.

Similar Messages

  • Error message pops up again after right correction of input

    Dear experts:
    I am doing a list using ALV control (OO), I put my validation logic in data changed handler. The validation is simple, to check whether a field is blank or not, if it is blank, pup up error messages and let the user to correct his/her input. But the strange thing is that after the error message firstly pops up, I close the error window,and input something in the field and press enter. No error message should be popped up. But the same error message pops up again. I debug the program found that after the first error, even I input something in the field, but the program does not get the value I input, so the same checking failed, and the error message pops up. And after the second popping up window has been closed, no further error message pops up when press Enter.
    Does any1 have any idea?
    Vincent
    CODE:
    METHOD HANDLE_DATA_CHANGED. "#EC NEEDED
    DATA: LW_INS TYPE LVC_S_MOCE,
    LV_FNAME TYPE LVC_FNAME,
    LT_MOD TYPE LVC_T_MODI,
    LW_MOD TYPE LVC_S_MODI,
    LV_TEXT(10) TYPE C,
    LV_MAX TYPE I,
    LV_ROWID TYPE I,
    LV_RES(12) TYPE C,
    LW_LIST TYPE ZTSRE007.
    LT_MOD] = ER_DATA_CHANGED->MT_MOD_CELLS[.
    LOOP AT LT_MOD INTO LW_MOD.
    IF LW_MOD-FIELDNAME = CNS_ZZTTSN.
    LV_FNAME = CNS_ZZTTSN.
    CALL METHOD ER_DATA_CHANGED->GET_CELL_VALUE
    EXPORTING
    I_ROW_ID = LW_MOD-ROW_ID
    I_FIELDNAME = LV_FNAME
    IMPORTING
    E_VALUE = LV_RES
    IF LV_RES IS INITIAL.
    LV_ROWID = LW_MOD-ROW_ID.
    CALL METHOD ER_DATA_CHANGED->ADD_PROTOCOL_ENTRY
    EXPORTING
    I_MSGID = CNS_MSGID
    I_MSGTY = CNS_MSGTY
    I_MSGNO = CNS_MSGNO
    I_FIELDNAME = LV_FNAME
    I_ROW_ID = LW_MOD-ROW_ID
    ENDIF.
    ENDIF.
    CLEAR: LV_ROWID,
    LV_FNAME.
    ENDLOOP.
    ENDMETHOD. "handle_data_changed
    Moderator message - Cross post locked
    Edited by: Rob Burbank on Sep 1, 2009 9:07 AM

    Hi,
    I am not sure how this is functioning but i am just trying to visualise your proble.
    I feel that after you input the value after the first pop up of the error message; the PAI is not getting called and thats the reason why the new data is not transferred to the internal table.
    What i suggest is after you input the data; press enter and check if the message is getting popped up again.
    Also call the method CHECK_CHANGED_DATA in your PAI.
    Just try with this. If not then probably there should be some thing else.
    Can you share your code if possible??
    Regards,
    Ankur Parab

  • Strange error message when I tried to use the "collaborate" function under "File"

    Has anyone else met this before? : I am trying to share my project with my team members. Tried File -> Collaborate and then try three options under it. Non e of them works. It asks for your Adobe ID in order to sign in and upload. However, every time I typed in my Adobe ID and password, it gave me strange error messages. The first time it says: User has not verified email address yet. I have been using this Adobe ID since 2008 or 2009 and of course I have verified my email address. But to make sure, I went back to my email box and search for emails about Adobe ID verification but I didn't find any (I never delete emails such as this).
    Then I tried to register a new Adobe ID. This time when I tried to singn in with the new Adobe ID, it will either say "Network may not be available" (which is not true because I am able to surf on the Internet at the same time), or it says "User has not accepted user condition/agreement".
    I feel so frustrated because I feel this is definitely not my mistake which caused the failure of log in.
    Hope someone can tell me what the reason is and how to fix it though.
    Thanks a lot.

    Hi Lilybiri,
    Thanks for your quick response. I followed your suggestion and verified my Adobe ID on acrobat.com.
    Now I can enter the collaborate function. However, everytime when I tried to send it to myself (for test purpose) I got another error message "You need to enter a valid emaill address". I saw someone else on this forum has met the same problem. Do you have any suggestion on what is the possible reason for this to happen?
    Again, thanks for the fast response. You have been helping me and other ppl so much.

  • Trying to update my Itunes software, now it does not want to work at all, givin strange error messages.

    Trying to update my Itunes software, now it does not want to work at all, givin strange error messages.
    First, when trying to sync ipod touch to Itunes, nothing happened. After that, Itunes suggested downloading and installing updates but now updates will not finish installation correctly and launch error messages. Any ideas?
    TKS !

    These ones are typically caused by underlying problems on the PC that also often cause Windows Updates to fail to install. If we can fix the Windows Update trouble, we can usually get the iTunes trouble cleaned up en passant.
    Go into your Windows update and try to check for new updates. If updates install, stock up on the ones you're behind on, restarting the PC if requested to do so. After the restart, try installing iTunes again. Does it go through this time for you?
    If windows updates fail to install, go into your Update History and doubleclick the failures. What alphanumeric codes appear for you? Are they also 800736B3s, or a different error code? If they're different, what codes are you getting in Windows Update?

  • Error Message: 'Distribution list still exists in the trash'

    HI All
    Please help us to provide the necessary solution as per the below query.
    1. Which SAP transaction or program can I run to find information on when & what Distribution Lists have been deleted and by whom?
    2. we are trying to recreate the same distribution list again  by using transaction code S023, we are unable to create the same distribution, we are getting the below error message.
    Error Message: 'Distribution list still exists in the trash'
    Regards

    SAp inbox

  • I rented a movie but it wont play.  Getting error message to try again later.

    I rented a movie but cant get it to play on my apple tv.  Getting error message to try again later.

    I have the same problem. Rented a movie, cannot get it to play. I don't seem to be having internet connection problems (sucessfully streaming HD content from Netflix right now on the same device) and I have rebooted and even reset the AppleTV device already with no improvement.
    Something going on in a data center somewhere at Apple tonight? This stuff used to work fine.
    john

  • Strange error message  duting Creation bid invitation

    hi!
    i try to create Bid invitation and add Bidder with contact person
    and get strange error message
    Message not found (in main memory)
    Do you know what's a problem?
    Thanks.

    Hi
    <b>Which System version are using ?</b>
    <u>Please go through the following SAP OSS Notes -></u>
    Note 1037262 BBP_QUOT_BOB: Surrogate Bid receives Message not found error
    Note 787154 Unreasonable error message in contract output forecast
    Note 732472 Incomplete attributes of a user lead to termination
    Note 684024 Error "Message not found (in main memory)"
    Note 641960 New processing of terms of payment in EBP 3.5
    Note 502534 Message "Log not found (in main memory)" in CW
    Hope this will definitely help.
    Regards
    - Atul

  • Strange Error Message In Return Order - (CRM B2C Internet Sales)

    I have a strange error message when creating a return order with reference to a standard order in internet sales B2C scenario.
    err message: Document 900038963 doesn't have document category  but (Notification E V2 068)
    and the standard order 900038963 is error free.

    Hi,
    I notice there is a Z class being called.
    Method: IF_EX_ORDER_SAVE~PREPARE of program ZCL_IM_PRICE_ADJUSTMENT=======CP
    You should check this customized class.
    Cheers,
    cady.

  • Strange Error Message at start up of FCE

    Hello all. I've got a strange error message at the Startup of FCE 3.5.1 on a MacBook Pro 2.33 C2D.
    It's this--
    "Unable to locate the following External devices:
    "Built-in Audio
    But FCE runs fine. I'm not sure what it's asking for. Any suggestions?
    MacBook Pro 2.33 C2D with 2GB of RAM   Mac OS X (10.4.9)   FCE 3.5.1, attached to LaCie 500GB drive and using Sony A1P camera

    Try uninstalling your MobileMe control panel.

  • ITunes won't launch and I get a strange error message-

    My iTunes will not launch and I get this strange error message: The iTunes application could not be opened. The disk could not be read from or written to. But I have no problems with the disk it is on, which is my harddisk. Help, help, help…

    I have now tried a billion things: None of them work. I still get the same error message, when I try to launch iTunes after logging into my user profile. However, I can launch iTunes 6.0.1 if I create another userprofile on my computer and log into that. But that isn't very helpful. I have also tried removing iTunes 6.0.1 and installing iTunes 4.7 instead. I can actually launch that. However, I cannot connect to the iTunes music store using iTunes 4.7 nor can I play any of the music purchased from the iTunes music store. What am I to do, except curse Apple for creating a version of iTunes that many people seem to have problems with?

  • Capture problem -- strange error messages -- computer freezes

    Upon 25 minutes or so into capturing, I get a strange error message to this effect: "analyzing DV audio -- validating audio data" -- the video slows to a crawl until it completely freezes -- rainbow wheel whirls nonstop -- sometimes command-option-escape force quits it, sometimes not and I have to reboot the computer. Sometimes I don't get the error message -- the computer capture screen freezes but the camera keeps going. Anyway here are the specs: Intel dual-processor iMac 300 GB with Mac OS X Leopard 10.5.5., format Mac OS Extended journaled. External hard drives Western Digital 500 GB formatted the same; QT 7.5.5; FCE 4.0.1; Settings: DV NTSC 48 Khz. Format & use - DV NTSC. Device control preset: firewire NTSC. Camera - Canon 900 ZR (miniDV tapes) hooked up to back of iMac via 6 pin shiny orange firewire for capture. I capture to Mac hard drive and then move video to external hard drive. Yes there is enough space and RAM. I had this problem before except the error message was "locating time break." So it was suggested I capture to hard disk. Seems like it's always something! I've lost hours trying to fix this problem. Hope someone can help. Thanks.

    12 bit. Haven't been having any audio problems with FCE. However, I tried the nightmare iDive and never got audio (much less anything else) to work with that. So I uninstalled it and asked for my money back.

  • Automatic Downloads and Strange Error Message: "You can auto-download purchases on this computer with just one Apple ID every 90 days"

    Hi gang-
    Yesterday I noticed that iTunes on my iMac had not auto-downloaded several new songs that I had recently purchased on my iPhone.    In iTunes Preferences, under Store -> Automatic Downloads, I always have Music selected so all songs purchased from any device using my Apple ID normally download automatically.
    To troubleshoot this, I double-checked my Preferences and sure enough, Music was de-selected under Automatic Downloads.   I then Selected it and clicked OK.   Here's where it gets weird and I get this error message:
    This computer is already associated with an Apple ID.  You can auto-download purchases on this computer with just one Apple ID every 90 days. You cannot associate this computer with a different Apple ID for 84 days.
    I read and re-read this message and none of it seems to apply to me.   I have only one Apple ID.   I am currently logged in with iTunes to that one Apple ID.   All my iTunes Music ever has been purchased with that one Apple ID.   I am not trying to associate this computer or any other with a different Apple ID.
    I logged iTunes out and then back in again and tried all the above- but same error message.
    So, as it is now, I am unable to turn on Automatic Downloads in iTunes.   
    Anyone know what the heck is going on?
    Thanks!
    Dave

    Hey gang-
    Okay, this gets more and more bizarre.   I sent a support email to Apple and basically they said  "...it seems that someone else associated your Mac with their Apple ID. That's the reason your purchases won't download."
    Yikes!   My wife and I live alone- and we have exactly one and only one Apple ID.    Would somebody have needed physical access to my iMac to do that?
    Support then said "You can view which devices or computers are currently associated, remove unused devices or computers, and see how long before they can be associated with a different Apple ID from the Account Information page in iTunes on your computer."
    Okay- so I logged into My Account in iTunes.   On the list of associated devices, my own iMac is NOT on that list.   But I am logged in under the same Apple ID I've had for years on that iMac.
    So my big question right now is...if my iMac (that I've owned for 5 years) has somehow been dis-associated from my Apple ID, how do I find out what Apple ID it is associated with?
    Thanks gang for trying to help me unravel a mystery.
    Dave
    PS- Here's an Apple Tech article on iTunes associations, but it doesn't really go beyond what we've discussed above:
    http://support.apple.com/kb/HT4627

  • When installing Illustrator, I get an error message not listed in the FAQ's

    We are currently experiencing some issues, please try again later. If the problem persists, contact customer support.
    The above is the error I receive when trying to install Illustrator. Is this a known issue, or specific to my operating system?

    Pat,
    Thank you for responding. I'm experiencing the same runaround. I don't know which Illustrator link to click, and the one I did click wound up giving me the same error message. I think the problem is I need to download it to the Cloud or to Google Drive. I don't seem to have an option for where Illustrator can be downloaded. I read on the Chromebook website that there is no hard drive on a Chromebook, that everything needs to be downloaded and retrieved to/from the Cloud. I need CS6 Illustrator and also need Adobe Photoshop for my class.
    When I tried downloading I also noticed I was in an area for people who haven't paid. How do I download it as part of my subscription?
    If downloading to the Cloud is possible, how do I access and retrieve programs downloaded to it?
    Best,
    Stephanie

  • Strange error message when creating Project Excel Template, can anyone explain?

    I am getting this error every time I create a Project Excel Template, and I don’t know why, nor do I understand what the error message is trying to tell me. The project is very simple, just a task list with resources assigned, but
    the resources are not assigned any costs or rates, as we don’t use. Any help is appreciated, as I have to explain this. Thx!
    Jigs
    Jiggy Gaton, Trainer and Media Consultant for Nepal and S. Asia

    thx John for your help. I don't think any thing at all is applied... I get the same message if I just create a new blank project and try the export. The resulting output looks fine - it's just the message that worries me. I am on the road training some folks
    in Africa in regards to the beauty of MS Project 2013, and this one is a bit embarrassing. Perhaps it's an OS thing?  The only substantial thing that's changed on my machine is that I went from Windows 8 to 8.1. Hmmm, also installed Visio. Well, thx again!
    jigs
    Jiggy Gaton, Trainer and Media Consultant for Nepal and S. Asia

  • Error message linking to field

    Hi guys,
    I'm trying to generate an error message that links to the field when clicked on.
    My problem is this. This error message is for a dropdown list. When user choose a blank selection, it will generate the error message to "fill in the mandatory field", with the link to the dropdown box.
    I tried lo_message_manager->report_attribute_error_message but it gives an error dump for null values (due to blank selection).
    I have also tried cl_wd_dynamic_tool=>check_mandatory_attr_on_view. This works fine for the other inputfields, but it doesn't work for the dropdown list.
    Please advise. Thank you very much.

    Hi,
    how is your dropdown done? by key/index?
    because with an indexed one, none is selected, thus returning a dump when you try to have
    an attribute error message (initial selected element).
    Greetz,
    Koen

Maybe you are looking for