Need help on arraylist for java

Discussion in 'General Chat' started by PinkBunny, Dec 2, 2016.

  1. PinkBunny

    PinkBunny Member

    Joined:
    May 9, 2016
    Messages:
    13
    Likes Received:
    1
    Reading List:
    Link
    If anyone can help me understand this concept, it'd be great
     
  2. Arcturus

    Arcturus Cat, Hidden Sith Lord

    Joined:
    Jan 1, 2016
    Messages:
    9,273
    Likes Received:
    17,815
    Reading List:
    Link
    What about it.....
     
    EienMugetsuTensho and saffu like this.
  3. Doomr

    Doomr Well-Known Member

    Joined:
    Dec 29, 2015
    Messages:
    599
    Likes Received:
    463
    Reading List:
    Link
    This brings back bad memories from last year... it's. good thing I'm majoring in Japanese now.
     
  4. PinkBunny

    PinkBunny Member

    Joined:
    May 9, 2016
    Messages:
    13
    Likes Received:
    1
    Reading List:
    Link
    everything to do with it, basically need it for an assignment
     
  5. saffu

    saffu dead

    Joined:
    Mar 2, 2016
    Messages:
    1,365
    Likes Received:
    4,133
    Reading List:
    Link
    Have you looked up the official documentation?
     
  6. SimplyAShadow

    SimplyAShadow Not Dead Yet

    Joined:
    Apr 21, 2016
    Messages:
    517
    Likes Received:
    784
    Reading List:
    Link
    This is information you can google... it's a list that can expand or contract but takes up more memory since it needs to take objects rather than primitive data types.
     
  7. Arcturus

    Arcturus Cat, Hidden Sith Lord

    Joined:
    Jan 1, 2016
    Messages:
    9,273
    Likes Received:
    17,815
    Reading List:
    Link
    EienMugetsuTensho likes this.
  8. PinkBunny

    PinkBunny Member

    Joined:
    May 9, 2016
    Messages:
    13
    Likes Received:
    1
    Reading List:
    Link
    only if i knew how javadocs worked, i suck at programming...
     
  9. Arcturus

    Arcturus Cat, Hidden Sith Lord

    Joined:
    Jan 1, 2016
    Messages:
    9,273
    Likes Received:
    17,815
    Reading List:
    Link
    That lists how to construct it, all of the various methods it contains, basically anything you might need to know
     
  10. MisterNoble

    MisterNoble Well-Known Member

    Joined:
    Oct 24, 2016
    Messages:
    150
    Likes Received:
    90
    Reading List:
    Link
    Are u a junior?
     
  11. saffu

    saffu dead

    Joined:
    Mar 2, 2016
    Messages:
    1,365
    Likes Received:
    4,133
    Reading List:
    Link
    Wait, if an assignment requires you to use this specific structure, your lecturer shouldh've already gone through it in class.

    Why don't you try going through your course lecture notes?
     
  12. StaticHD

    StaticHD Supreme Novel Observer

    Joined:
    Oct 22, 2015
    Messages:
    468
    Likes Received:
    215
    Reading List:
    Link
    Wjy not watch video education information on Java?
     
  13. methael

    methael Well-Known Member

    Joined:
    Aug 12, 2016
    Messages:
    79
    Likes Received:
    57
    Reading List:
    Link
    I study this stuff on youtube, it got tons of tutorials...
     
  14. JustaReader

    JustaReader Well-Known Member

    Joined:
    Sep 13, 2016
    Messages:
    574
    Likes Received:
    3,808
    Reading List:
    Link
    What do you need help with specifically? Arraylists are nice
     
    EienMugetsuTensho likes this.
  15. Frostypine

    Frostypine Well-Known Member

    Joined:
    Jun 27, 2016
    Messages:
    82
    Likes Received:
    94
    Reading List:
    Link
    I like to think of data types as boxes, and array lists are like a chain of boxes connected together. One box can hold one thing big or small but a chain of boxes can hold things of various sizes, though of only one type of thing. You can't keep numbers(int,double etc.) with letters and sentences (char, string etc.). One important thing to keep in mind and continually remember is that when it comes to things like lists is that the index or box location number usually is 0. So if you have an array of size 3 the boxes would be array[0] array[1] and array[2], there is no array three because 2 is three.
     
    maharaya likes this.
  16. JustaReader

    JustaReader Well-Known Member

    Joined:
    Sep 13, 2016
    Messages:
    574
    Likes Received:
    3,808
    Reading List:
    Link
    Now linkedlists and nodes.... thats fun...
     
  17. Teddywonka

    Teddywonka A wonka that wonks a wonk

    Joined:
    Nov 18, 2015
    Messages:
    232
    Likes Received:
    173
    Reading List:
    Link
    Array...just think about it as a collection of things. Well, at first its difficult but as you get used to it, it will become easy.
    For simple example:

    int [] wonka = new int[3];

    This is compose of data type (int or integer) and the bracket[] which indicates that its an array. I assume that you know diferent data types liek char, int, float and so on.

    This one new int[3]; means that it's instantiated and the number 3, is the size of array.

    And remember, always remember, array starts at zero. Yes its zero. Whenever you access or try to put something in the array, you always begin at zero even though its size is 3. Weird right? but you will get used to it. Hehe

    For quick example:

    wonka[3]=[1, 2, 3]; // here is the one line example of adding values to the array

    or you can do this manually.

    wonka[0] = 1;
    wonka[1] = 2;
    wonka[2] = 3;

    You notice that in wonka[0] = 1; It starts with zero and its value is 1 (you can manipulate its value if you want)
    And it ends at wonka[2] right? yup that's its array number..even though we select its size as 3, its array number will always end with minus one (-1).

    Remember that the array number will always (-1) to the specified length (we select 3 before) because it starts at array number zero.

    Please reread this if you dont understand and try to access w3schools, youtube videos and your book because it will be helpful to you.

    In getting the values you can do this

    System.out.print("first wonka number is" + wonka[0]);

    Output is: first wonka number is 1

    Looping will be soon used in array as they will always partners in crime as you go forward in your study so study loops in advance.But focus first in array.
    Be warned that complex array will be on your way.

    Happy JAVA!!!hahahaha
     
  18. Arcturus

    Arcturus Cat, Hidden Sith Lord

    Joined:
    Jan 1, 2016
    Messages:
    9,273
    Likes Received:
    17,815
    Reading List:
    Link
    That is an array, not an arraylist. Arraylist are a different animal then arrays.
     
  19. PinkBunny

    PinkBunny Member

    Joined:
    May 9, 2016
    Messages:
    13
    Likes Received:
    1
    Reading List:
    Link
    If anyone could help me on my assignment, that would be great...
     
  20. JustaReader

    JustaReader Well-Known Member

    Joined:
    Sep 13, 2016
    Messages:
    574
    Likes Received:
    3,808
    Reading List:
    Link
    why don't you post the picture then or go onto tutorialspoint, just google arraylist and they tell you all about them