Results 1 to 9 of 9
  1. #1
    javagirl is offline Member
    Join Date
    Feb 2014
    Posts
    6
    Rep Power
    0

    Default Passing a value into a Method

    Does the following code pass a value into a method?

    /code

    lnValue[x][y] = computelnValue();

    /code

  2. #2
    KevinWorkman's Avatar
    KevinWorkman is offline Crazy Cat Lady
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    3,932
    Rep Power
    8

    Default Re: Passing a value into a Method

    What do you think?

    We aren't just going to do your homework for you.
    How to Ask Questions the Smart Way
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

  3. #3
    kneitzel is offline Senior Member
    Join Date
    Feb 2014
    Posts
    447
    Rep Power
    1

    Default Re: Passing a value into a Method

    Just think about methods. If you want to pass something in: how do you have to define the method and how do you call it?
    And what is your code doing exactly? You should be able to answer that yourself.

    If you have trouble to understand it: maybe you can tell us, what is confusing you?

  4. #4
    mbschultz97 is offline Super OP Noob
    Join Date
    May 2014
    Location
    Virginia
    Posts
    65
    Rep Power
    0

    Default Re: Passing a value into a Method

    Java Code:
    public int addTen(int number){
          return number + 10;
    }

  5. #5
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,308
    Rep Power
    25

    Default Re: Passing a value into a Method

    @mbschultz97
    What is the purpose of posting code without any comments?
    If you don't understand my response, don't ignore it, ask a question.

  6. #6
    mbschultz97 is offline Super OP Noob
    Join Date
    May 2014
    Location
    Virginia
    Posts
    65
    Rep Power
    0

    Default Re: Passing a value into a Method

    Quote Originally Posted by Norm View Post
    @mbschultz97
    What is the purpose of posting code without any comments?
    The code seems pretty self-explanatory

  7. #7
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,308
    Rep Power
    25

    Default Re: Passing a value into a Method

    If it was that simple would the OP have asked the question? Where is the OP confused? How did the code help the OP understand? I'm sure that you understand. But does the OP understand?

    The example is not complete because it does not show how to call the method.
    If you don't understand my response, don't ignore it, ask a question.

  8. #8
    KevinWorkman's Avatar
    KevinWorkman is offline Crazy Cat Lady
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    3,932
    Rep Power
    8

    Default Re: Passing a value into a Method

    Quote Originally Posted by mbschultz97 View Post
    The code seems pretty self-explanatory
    No, it is not. It seemingly has nothing to do with the original question.
    How to Ask Questions the Smart Way
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

  9. #9
    mbschultz97 is offline Super OP Noob
    Join Date
    May 2014
    Location
    Virginia
    Posts
    65
    Rep Power
    0

    Default Re: Passing a value into a Method

    My bad... I'll work on making better responses when trying to help people

Similar Threads

  1. Replies: 4
    Last Post: 03-28-2013, 08:40 PM
  2. Passing an array through a method
    By vNatural in forum New To Java
    Replies: 5
    Last Post: 02-14-2013, 04:54 AM
  3. Passing method results to each other
    By dexterc in forum New To Java
    Replies: 3
    Last Post: 11-10-2011, 11:49 AM
  4. Passing method as argument
    By susieferrari in forum New To Java
    Replies: 26
    Last Post: 06-13-2011, 10:43 AM
  5. Passing an array to a method.
    By twcast in forum New To Java
    Replies: 9
    Last Post: 02-10-2010, 09:13 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
  •