Results 1 to 3 of 3
- 07-01-2007, 02:06 AM #1
Member
- Join Date
- Jun 2007
- Posts
- 95
- Rep Power
- 0
Problem when displays in the terminal
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 readJava 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++; } }
but i just keep getting error messages with this??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++; } }
Thanks.
Felissa:p
- 07-01-2007, 02:09 AM #2
Senior Member
- Join Date
- Jun 2007
- Posts
- 114
- Rep Power
- 0
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.
Good LuckJava Code:System.out.println(index+":")(notes.get(index));
Albert:rolleyes:Last edited by Albert; 07-01-2007 at 02:12 AM.
- 07-01-2007, 02:14 AM #3
Member
- Join Date
- Jun 2007
- Posts
- 95
- Rep Power
- 0
Similar Threads
-
Addition program that displays the sum of two numbers
By Java Tip in forum Java TipReplies: 0Last Post: 03-28-2008, 08:46 PM -
VT6530 Terminal Emulator 0.2.2
By JavaBean in forum Java SoftwareReplies: 0Last Post: 03-01-2008, 10:18 PM -
Write an application that displays the numbers 1 to 4 on the same line
By toby in forum New To JavaReplies: 1Last Post: 07-23-2007, 04:33 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks