Java Forums

Main Menu
Home
Today's Posts
FAQ
Search
Contact Us

Java Network
Java Tips
Java Tips Blog

Sponsored Links





Welcome to the Java Forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community, you will:

  • have access to post topics
  • communicate privately with other members (PM)
  • not see advertisements between posts
  • have the possibility to earn one of our surprises if you are an active member
  • access many other special features that will be introduced later.

Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 07-01-2007, 03:06 AM
Member
 
Join Date: Jun 2007
Posts: 95
Felissa is on a distinguished road
Problem when displays in the terminal
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

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
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 07-01-2007, 03:09 AM
Senior Member
 
Join Date: Jun 2007
Posts: 114
Albert is on a distinguished road
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.

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

Albert

Last edited by Albert : 07-01-2007 at 03:12 AM.
Bookmark Post in Technorati
Reply With Quote
  #3 (permalink)  
Old 07-01-2007, 03:14 AM
Member
 
Join Date: Jun 2007
Posts: 95
Felissa is on a distinguished road
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
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Addition program that displays the sum of two numbers Java Tip Java Tips 0 03-28-2008 09:46 PM
VT6530 Terminal Emulator 0.2.2 JavaBean Java Announcements 0 03-01-2008 11:18 PM
Write an application that displays the numbers 1 to 4 on the same line toby New To Java 1 07-23-2007 05:33 PM


All times are GMT +3. The time now is 07:04 PM.


VBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org