Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 7 of 7

Thread: Arrays

  1. #1
    Junior Member LeeDD's Avatar
    Join Date
    Feb 2013
    Location
    Caribbean
    Posts
    27
    My Mood
    Relaxed
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default Arrays

    How do you use a method to insert values in an array. Can someone please explain this. A Method That uses to arguments.. int for a value provided an a double to hold d actual value.
    Last edited by LeeDD; February 22nd, 2013 at 05:19 PM. Reason: thought that was all the info i wanted to put.. but apparently not


  2. #2
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,042
    Thanks
    63
    Thanked 2,708 Times in 2,658 Posts

    Default Re: Arrays

    use a method to insert values in an array
    pass the array to the method as an argument and then use normal array accessing techniques to change values in the array.
    If you don't understand my answer, don't ignore it, ask a question.

  3. The Following User Says Thank You to Norm For This Useful Post:

    LeeDD (February 23rd, 2013)

  4. #3
    Junior Member LeeDD's Avatar
    Join Date
    Feb 2013
    Location
    Caribbean
    Posts
    27
    My Mood
    Relaxed
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default Re: Arrays

    ok thanks... but what if what i really wanna do is to store values in an array, which is a class field?

  5. #4
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,042
    Thanks
    63
    Thanked 2,708 Times in 2,658 Posts

    Default Re: Arrays

    store values in an array,
    Once the method has a reference to the array, it can store values in the array.
    If you don't understand my answer, don't ignore it, ask a question.

  6. #5
    Junior Member LeeDD's Avatar
    Join Date
    Feb 2013
    Location
    Caribbean
    Posts
    27
    My Mood
    Relaxed
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default Re: Arrays

    does it need a constructor?

  7. #6
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,042
    Thanks
    63
    Thanked 2,708 Times in 2,658 Posts
    If you don't understand my answer, don't ignore it, ask a question.

  8. #7
    Junior Member LeeDD's Avatar
    Join Date
    Feb 2013
    Location
    Caribbean
    Posts
    27
    My Mood
    Relaxed
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default Re: Arrays

    ok then thanks.. i will send u the question and then my coding..

    --- Update ---

    thanks very much!! the tutorial is exactly what i had need..

Similar Threads

  1. 2D arrays
    By Fluffy in forum What's Wrong With My Code?
    Replies: 1
    Last Post: December 5th, 2012, 05:11 PM
  2. Help with Arrays
    By xdx in forum What's Wrong With My Code?
    Replies: 3
    Last Post: October 10th, 2012, 12:39 AM
  3. 2d arrays
    By jonathanfox in forum Java Theory & Questions
    Replies: 5
    Last Post: August 7th, 2012, 09:02 AM
  4. Arrays
    By Emperor_Xyn in forum Java Theory & Questions
    Replies: 6
    Last Post: December 9th, 2011, 07:24 PM
  5. Arrays
    By mlan in forum Java Theory & Questions
    Replies: 2
    Last Post: February 26th, 2010, 10:23 AM