Search:

Type: Posts; User: copeg

Search: Search took 0.12 seconds.

  1. Replies
    5
    Views
    1,673

    Re: 1st time using methods

    Well technically the size is returned with the array (via the length property). But regardless, you cannot recreate the reference to the array in the method and hope that change takes effect outside...
  2. Replies
    5
    Views
    1,673

    Re: 1st time using methods

    Didn't spot this earlier (obviously), but you re-assign the variable mat in the load method, once the load method exits that variable is out of scope (and the parameter unchanged - pass by value )....
  3. Replies
    5
    Views
    1,673

    Re: 1st time using methods

    You've passed the array as a parameter, so just loop through the array by row/colum


    for ( int i = 0; i < mat.length; i++ ){
    for ( int j = 0; j < mat[i].length; j++ ){
    //do something...
Results 1 to 3 of 3