Results 1 to 3 of 3
  1. #1
    dredd is offline Member
    Join Date
    Mar 2013
    Posts
    11
    Rep Power
    0

    Default How can I create a get method to return a matrix reference?

    I wrote:
    public int[][] getTerrain(){
    return this._mTerrain;
    }

    but how can I use the getTerrain() function in order to get values, I've tried:

    int b=getTerrain()[i][j];

    but it isn't working.

  2. #2
    JosAH's Avatar
    JosAH is online now Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,783
    Blog Entries
    7
    Rep Power
    21

    Default Re: How can I create a get method to return a matrix reference?

    What does 'isn't working' mean?

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  3. #3
    dredd is offline Member
    Join Date
    Mar 2013
    Posts
    11
    Rep Power
    0

    Default Re: How can I create a get method to return a matrix reference?

    It's ok I understood my mistake I didn't created the object to initiate the method of getTerrain()

Similar Threads

  1. Replies: 3
    Last Post: 07-17-2011, 05:16 PM
  2. Replies: 3
    Last Post: 06-22-2011, 07:58 PM
  3. Create Image from Arbitrary 2D Matrix of Data
    By dvreed77 in forum Java 2D
    Replies: 13
    Last Post: 06-12-2011, 10:42 PM
  4. How to create pass by reference??
    By --> xeiyne! in forum CLDC and MIDP
    Replies: 4
    Last Post: 04-08-2010, 07:43 PM
  5. Replies: 5
    Last Post: 04-06-2009, 11:10 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •