Results 1 to 2 of 2

Thread: Sending an array to a method.

  1. #1

    Thread Starter
    Lively Member MHENK's Avatar
    Join Date
    Sep 2001
    Location
    Wisconsin
    Posts
    99

    Sending an array to a method.

    Hi there-

    I have created a 10X10 array, that I would like to display. I can get the values to display, in the format that I want them to display. Now, however, I need to write a METHOD that I pass this array to, and have the method display the array. how would I go about passing the array tableofdata[][] to the method showBoard?

    -Mike
    "Have you ever woken up, looked at yourself in the mirror, and said 'screw the diet, how fat can i possibly get'?"

  2. #2
    Dazed Member
    Join Date
    Oct 1999
    Location
    Ridgefield Park, NJ
    Posts
    3,418
    <method header>(<formal parameter list>)<throws clause>{
    <method body>
    }


    All you would have to do is specify tableofdata[][] as a method parameter. Then pass the array refrence to the method.

    public void showBoard(tableofdata[][] td)

Posting Permissions

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



Click Here to Expand Forum to Full Width