Results 1 to 2 of 2
- 06-02-2010, 11:08 PM #1
Member
- Join Date
- Jun 2010
- Posts
- 5
- Rep Power
- 0
How do I modify the values in an object array?
Hello, I am new to these forums, and i would like to know how one would go about modifying the values for a particular object in an object array.
For example, say I had a constructor for an object of type "Car", having 2 integer variables, written in "Car" class.
I then create an array of type "Car" with a length of 10 in my test class.
How would I modify the 2 integer values?
Would I need a mutator method in my Car class to do this?
Thanks for your help ahead of time. :)
-
Yes, a mutator method or "setter" would probably be your best bet here.
Welcome to the Java-Forums.com by the way!
Similar Threads
-
Printing values from object in Array?
By thesinter in forum New To JavaReplies: 3Last Post: 01-20-2010, 05:19 AM -
Assigning values to an object
By camper2 in forum New To JavaReplies: 4Last Post: 04-05-2009, 03:13 AM -
passing object as value for checkbox values??
By Pooja Deshpande in forum JavaServer Pages (JSP) and JSTLReplies: 0Last Post: 03-17-2009, 11:55 AM -
Need help in getting values from request object
By nn12 in forum New To JavaReplies: 0Last Post: 11-21-2008, 08:17 AM -
[SOLVED] Creating List of Values Using ClipBoard Object
By Judoon_Platoon in forum Java AppletsReplies: 2Last Post: 05-21-2008, 08:07 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks