AntoniRyszard
asked on
Changinf object values?
Hello,
Could anyone advise, I created an ArrayList of objects and now trying to loop through the objects and change the red value in each object.
Thanks
ArrayList array = new ArrayList();
Next I added the objects, and following code loops through the array.
for(int i = 0; i < array.size(); i++){
RGB object = (RGB)array.get(i);
double red = object.getRed() / 255.0;
//Add red to array in the current object?
}
Could anyone advise, I created an ArrayList of objects and now trying to loop through the objects and change the red value in each object.
Thanks
ArrayList array = new ArrayList();
Next I added the objects, and following code loops through the array.
for(int i = 0; i < array.size(); i++){
RGB object = (RGB)array.get(i);
double red = object.getRed() / 255.0;
//Add red to array in the current object?
}
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
double getReg(){
return red;
}
void setRed(double red){
this.red = red;
}