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.
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.
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
pass the array to the method as an argument and then use normal array accessing techniques to change values in the array.use a method to insert values in an array
If you don't understand my answer, don't ignore it, ask a question.
LeeDD (February 23rd, 2013)
ok thanks... but what if what i really wanna do is to store values in an array, which is a class field?
Once the method has a reference to the array, it can store values in the array.store values in an array,
If you don't understand my answer, don't ignore it, ask a question.
does it need a constructor?
Classes have constructors. Arrays don't have constructors.
See the tutorial:
Providing Constructors for Your Classes (The Java™ Tutorials > Learning the Java Language > Classes and Objects)
http://docs.oracle.com/javase/tutori...ts/arrays.html
If you don't understand my answer, don't ignore it, ask a question.
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..