• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Liutauras Vilda
  • Paul Clapham
Sheriffs:
  • paul wheaton
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Piet Souris
Bartenders:
  • Mike London

java.util.ArrayList

 
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I have a java class called myObject with three properties like prop1,prop2,prop3.
I have another object called objectslist with an arraylist of myobjects as its properties and objlistprop.

myObject{
prop1;
prop2;
prop3;
}

Objectslist{
arraylist myobjects
prop2
}

in my jsp I want to update prop1 of my object where myobject is [objectlist.get(i)] ith element of the list.

Thanks,
Krupa
 
author and iconoclast
Posts: 24204
44
Mac OS X Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Please don't post the same thread to multiple forums -- it's just a waste of people's time.

Now: do you have a question?
 
Krupa Eng
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sorry about posting in 2 places. I didn't know which one is the right place.

My question is how can I update the object.

for example.

iterator it = mylist.getIterator
while (it.next){
(MyObject)currobj = (MyObject) it.next();
if(currobj.getProp2.equals("AB")){
currobj.setProp3("XYZ");
}
}

The setProp3 is giving me an error.

How can I set the prop3 value.

Thanks
 
Ernest Friedman-Hill
author and iconoclast
Posts: 24204
44
Mac OS X Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Krupa Eng:

The setProp3 is giving me an error.



What's the error message? Is it a runtime error, or a compiler error? If it's the latter, does it point to a particular line of code? I don't think we can help unless we understand the problem you're having.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic