Results 1 to 3 of 3
  1. #1
    Felissa is offline Member
    Join Date
    Jun 2007
    Posts
    95
    Rep Power
    0

    Default Problem when displays in the terminal

    Java Code:
    public void listNotes()
    {
    int index = 0; //could do this ....int indexB = notes.size();
    while(index < notes.size()){
    System.out.println(notes.get(index));
    index++;
    }
    }
    Does anybody know how to alter this code so that when it displays in the terminal window it will come up with the index number besides the note accompanying that specific note number??..i know at the moment only the note will print out but no index number..i tried to alter the code so it read

    Java Code:
    public void listNotes()
    {
    int index = 0; //could do this ....int indexB = notes.size();
    while(index < notes.size()){
    System.out.println(index+":")(notes.get(index));
    index++;
    }
    }
    but i just keep getting error messages with this??

    Thanks.

    Felissa:p

  2. #2
    Albert is offline Senior Member
    Join Date
    Jun 2007
    Posts
    114
    Rep Power
    0

    Default

    In the future it actual error messages are a useful thing to post, otherwise it's like bringing your car in and telling him to "Fix it" Sometimes he can see that you have a flat tire, but other times he's going to have to tear apart the engine and check everything to see the problem.

    Luckily this time it seems you have a flat tire.

    Java Code:
    System.out.println(index+":")(notes.get(index));
    Good Luck

    Albert:rolleyes:
    Last edited by Albert; 07-01-2007 at 02:12 AM.

  3. #3
    Felissa is offline Member
    Join Date
    Jun 2007
    Posts
    95
    Rep Power
    0

    Default

    Sorry bout that, i was just eager to write my problem down and forgot to rite the error message..


    thanks for your help, it sorted my code out great!!..and l remember your advice for next time.

    Felissa:p

Similar Threads

  1. Replies: 0
    Last Post: 03-28-2008, 08:46 PM
  2. VT6530 Terminal Emulator 0.2.2
    By JavaBean in forum Java Software
    Replies: 0
    Last Post: 03-01-2008, 10:18 PM
  3. Replies: 1
    Last Post: 07-23-2007, 04:33 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
  •