Thread: [BEGINNER] [ASAP] 2d array issue

Results 1 to 3 of 3
  1. #1 [BEGINNER] [ASAP] 2d array issue 
    Software Developer

    Tyrant's Avatar
    Join Date
    Jul 2013
    Age
    24
    Posts
    1,562
    Thanks given
    678
    Thanks received
    423
    Rep Power
    1060
    Hey guys, I'm pretty new to java and I started learning the basics of, whatever thats my issue I tried making a new of adding items when starting
    so I decided using a 2d-array.

    Now, I don't really know how its should be done, what I want it to be is something similiar to that:

    Code:
    public void addStarter() {
    int[][] items2Add = {{15444, 1}, {1215, 1}, {6689, 1}};
                    for (int v=0; v < items.length; v3++) {
                    c.getItems().addItem(items2Add[v], What should be here?);
                    }
    }
    I have no idea what to do from here, what should be typed after items2Add[v] and why?

    Thanks for helpers
    Reply With Quote  
     

  2. #2  
    Respected Member


    Join Date
    Jan 2009
    Posts
    5,743
    Thanks given
    1,162
    Thanks received
    3,603
    Rep Power
    5000
    Quote Originally Posted by DharokZ View Post
    Hey guys, I'm pretty new to java and I started learning the basics of, whatever thats my issue I tried making a new of adding items when starting
    so I decided using a 2d-array.

    Now, I don't really know how its should be done, what I want it to be is something similiar to that:

    Code:
    public void addStarter() {
    int[][] items2Add = {{15444, 1}, {1215, 1}, {6689, 1}};
                    for (int v=0; v < items.length; v3++) {
                    c.getItems().addItem(items2Add[v], What should be here?);
                    }
    }
    I have no idea what to do from here, what should be typed after items2Add[v] and why?

    Thanks for helpers
    Code:
    c.getItems().addItem(items2Add[v][0], items2Add[v][1]);
    Please do not bump under 24 hours in the future.
    Reply With Quote  
     

  3. #3  
    Software Developer

    Tyrant's Avatar
    Join Date
    Jul 2013
    Age
    24
    Posts
    1,562
    Thanks given
    678
    Thanks received
    423
    Rep Power
    1060
    Quote Originally Posted by Stuart View Post
    Code:
    c.getItems().addItem(items2Add[v][0], items2Add[v][1]);
    Please do not bump under 24 hours in the future.
    Tysm, sorry tho :3
    Reply With Quote  
     


Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


User Tag List

Similar Threads

  1. 2D Array
    By Lennard in forum Help
    Replies: 4
    Last Post: 06-27-2012, 11:19 PM
  2. 2D arrays in ruby
    By Kelvin in forum Help
    Replies: 2
    Last Post: 05-29-2012, 02:21 AM
  3. 2d array help;
    By Kastro in forum Help
    Replies: 3
    Last Post: 11-30-2009, 01:22 PM
  4. 2d arrays
    By Kastro in forum Requests
    Replies: 2
    Last Post: 11-17-2009, 09:06 AM
  5. 2d array herblore
    By Lighten in forum Snippets
    Replies: 6
    Last Post: 08-24-2009, 05:25 AM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •