File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Java in General and the fly likes ArrayList Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "ArrayList" Watch "ArrayList" New topic
Author

ArrayList

Cougar Vis
Greenhorn

Joined: May 12, 2004
Posts: 19
Me using the ArrayList library from Java for O.O programming, but i am not quite sure one 3 little things

1.Can i assign the data into a specific slot E.g "banana" a string into slot 3?

2.How do i add a data, do i use "add.xXxX"? or use "set", in O.O prgramming environment?

3.How do i recall the data from a specific slot? Using the example in #1.

Waiting for reply & Thanx in advance

Respect
marc weber
Sheriff

Joined: Aug 31, 2004
Posts: 11343

Refer to the API for ArrayList...

http://java.sun.com/j2se/1.5.0/docs/api/java/util/ArrayList.html

In particular, note the methods:
  • add(int index, E element)
  • get(int index)


  • "We're kind of on the level of crossword puzzle writers... And no one ever goes to them and gives them an award." ~Joe Strummer
    sscce.org
    Dirk Schreckmann
    Sheriff

    Joined: Dec 10, 2001
    Posts: 7023
    Moving this to the Intermediate forum...


    [How To Ask Good Questions] [JavaRanch FAQ Wiki] [JavaRanch Radio]
     
    I agree. Here's the link: http://aspose.com/file-tools
     
    subject: ArrayList
     
    Similar Threads
    Removing from an array
    Imbricated loops in jsp page
    Logic iterate and vo
    question about jess templates
    Displaying a table in JSP using JSTL tags