Search:

Type: Posts; User: game06

Search: Search took 0.08 seconds.

  1. Replies
    22
    Views
    1,163

    Re: storeing 2d array in arraylist?

    2d array

    ...... i just want to store 2d array in arraylist and print it. can you just post me the link where i can read about it?

    thanks
  2. Replies
    22
    Views
    1,163

    Re: storeing 2d array in arraylist?

    i am making a tile map. so 2d int array(bb) is the map. online when ever they make a tile map they seem to store in some kind of arraylist.

    which do you think the best choose of what iam trying...
  3. Replies
    22
    Views
    1,163

    Re: storeing 2d array in arraylist?

    SomeClass smcls = aa.get(x);
    AnotherClass anCls = smcls.get(y);

    but with this i will have to make two more classes???

    i am sure there is a way in java so i dont need to create classes. i just...
  4. Replies
    22
    Views
    1,163

    Re: storeing 2d array in arraylist?

    why is this printing the address. should it print the value? bc of aa.get(y). isnt that same as in array aa[y]. which prints a value?



    so close just need to print the arraylist


    code that i...
  5. Replies
    22
    Views
    1,163

    Re: storeing 2d array in arraylist?

    yes, i am not using array tho. i am using arraylist. variable aa is arraylist.
    ex: there is no array here.

    for(int y = 0; y < aa.size(); y++) {
    for(int x = 0; x < aa.size(); x++){
    ...
  6. Replies
    22
    Views
    1,163

    Re: storeing 2d array in arraylist?

    like aa.add(bb); //thats why it was print so much data on output

    and to print arraylist would you print like 2d array?
    1st add so two loops or you wont need the two loops
    2nd print



    ...
  7. Replies
    22
    Views
    1,163

    Re: storeing 2d array in arraylist?

    so to store 2d array in 2d arraylist you have to do this below:



    ArrayList<int[][]> aa= new ArrayList();
    int bb[][] = { {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
    ...
  8. Replies
    22
    Views
    1,163

    Re: storeing 2d array in arraylist?

    also can u tell me can i store 2d array in 2d arraylist? or there is no such thing as 2darraylist.
    and which of below is right if i want to store 2d array in arraylist

    1) ArrayList<Integer[][]>...
  9. Replies
    22
    Views
    1,163

    Re: storeing 2d array in arraylist?

    error:



    line 18 is aa.add(x,y);

    also change it to aa.add(bb.[x],bb.[y]); doesnt work.

    ------------------------------------------------------------------
    also can u tell me can i store...
  10. Replies
    22
    Views
    1,163

    Re: storeing 2d array in arraylist?

    i want arraylist to print like 2d array.
    also note <Integer[][]> give me error. so i added <Integer>
    but out put is:
    [5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,...
  11. Replies
    22
    Views
    1,163

    storeing 2d array in arraylist?

    how to save 2d array in arraylist and how to print it???


    import java.util.ArrayList;

    public class aaa {
    public static void main(String[]args)
    {
    ArrayList<Integer[][]> aa= new...
Results 1 to 11 of 11