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.
Printable View
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.
pass the array to the method as an argument and then use normal array accessing techniques to change values in the array.Quote:
use a method to insert values in an array
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.Quote:
store values in an array,
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
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..