Thursday, February 4, 2010

Re: [Java] Java - Array List

This won't do what you're looking for. Figure out how to do it with
pre-JDK 1.5 "for". You can get at the index easily that way.

-Java Guy


s4rd59 wrote:
>
> Hi,
> Please could someone help me with the following:
>
> Modify the listNotes method so that it prints a number in front of
> each note that corresponds to its index in the ArrayList. For example:
>
> 0: Do some shopping
> 1: Wait for postman
> 2: Attend meeting at 10.45
>
> This is the listNotes method which I have created so far:
> /**
> * List all notes in the notebook.
> */
> public void listNotes()
> {
> for(String note : notes) {
> System.out.println(note);
> }
> }
> }
>
> Thanks
>
>


------------------------------------

Visit http://aiaiai.com or http://jgame.org for more groups to join.
Java Official Group is created for the following topics: Java 2 Enterprise Edition - J2EE, Java 2 Standard Edition - J2SE, Java 2 Micro Edition - J2ME, XML, XSL, XSD, XPATH, Web Services, Jini, JXTA for all type of Java Geeks.
Whoever posts spam / ads / job related message will be BANNED IMMEDIATELYYahoo! Groups Links

<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/Java_Official/

<*> Your email settings:
Individual Email | Traditional

<*> To change settings online go to:
http://groups.yahoo.com/group/Java_Official/join
(Yahoo! ID required)

<*> To change settings via email:
Java_Official-digest@yahoogroups.com
Java_Official-fullfeatured@yahoogroups.com

<*> To unsubscribe from this group, send an email to:
Java_Official-unsubscribe@yahoogroups.com

<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/

No comments:

Post a Comment