Usage of Arraylists in Java

Discussion in 'Java' started by Weasley, Dec 9, 2009.

  1. Weasley

    Weasley Guest

    Hello Friends,

    I wrote a function yesterday, and defined an String array there. I
    defined it like,

    String[] arr = null;

    No error was shown by my IDE. I thought to move ahead. But when I
    tried to increase the size of my array, I was caught.

    Now I learned the difference b/w Array & an Array List.

    Read more .. http://www.ezdia.com/How_to_use_Array_List_in_Java/Content.do?id=1022
     
    Weasley, Dec 9, 2009
    #1
    1. Advertising

  2. In article
    <>,
    Weasley <> wrote:

    Perhaps you meant this:

    <http://www.java-samples.com/showtutorial.php?tutorialid=234>

    --
    John B. Matthews
    trashgod at gmail dot com
    <http://sites.google.com/site/drjohnbmatthews>
     
    John B. Matthews, Dec 9, 2009
    #2
    1. Advertising

  3. On 9 Gru, 10:03, Weasley <> wrote:
    > Hello Friends,
    >
    > I wrote a function yesterday, and defined an String array there. I
    > defined it like,
    >
    > String[] arr = null;
    >
    > No error was shown by my IDE.


    Because there is no error in this line. Initializing reference to null
    is always valid.

    I thought to move ahead. But when I
    > tried to increase the size of my array, I was caught.
    >


    ??

    > Now I learned the difference b/w Array & an Array List.
    >
    > Read more ..http://www.ezdia.com/How_to_use_Array_List_in_Java/Content.do?id=1022


    ??
     
    Marcin Rze¼nicki, Dec 9, 2009
    #3
  4. Weasley

    Roedy Green Guest

    On Wed, 9 Dec 2009 01:03:35 -0800 (PST), Weasley
    <> wrote, quoted or indirectly quoted someone
    who said :

    >String[] arr = null;
    >
    >No error was shown by my IDE. I thought to move ahead. But when I
    >tried to increase the size of my array, I was caught.
    >
    >Now I learned the difference b/w Array & an Array List.


    That does not make sense. You did not allocate your array, so you
    can't very well talk about increasing its size.

    See http://mindprod.com/jgloss/array.html
    http://mindprod.com/jgloss/arraylist.html

    --
    Roedy Green Canadian Mind Products
    http://mindprod.com
    The future has already happened, it just isn’t evenly distributed.
    ~ William Gibson (born: 1948-03-17 age: 61)
     
    Roedy Green, Dec 9, 2009
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?UG9udGlNYXg=?=

    ArrayList of ArrayLists: How to implement IEnumerable

    =?Utf-8?B?UG9udGlNYXg=?=, Jul 5, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    440
    =?Utf-8?B?UG9udGlNYXg=?=
    Jul 5, 2004
  2. Jim Bancroft
    Replies:
    3
    Views:
    1,893
    Bob Weiner
    May 2, 2005
  3. =?Utf-8?B?RE9UTkVUR1VZ?=

    Comparing two arraylists

    =?Utf-8?B?RE9UTkVUR1VZ?=, Aug 18, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    3,648
    =?Utf-8?B?VmlqYXlha3Jpc2huYQ==?=
    Aug 24, 2005
  4. Gary Newell

    an Array of ArrayLists in Java 5

    Gary Newell, Dec 13, 2004, in forum: Java
    Replies:
    2
    Views:
    25,043
    Gary Newell
    Dec 14, 2004
  5. Weasley

    Arrays and Arraylists in Java

    Weasley, Dec 9, 2009, in forum: Javascript
    Replies:
    1
    Views:
    122
    Michael Haufe (\TNO\)
    Dec 9, 2009
Loading...

Share This Page