java - Update second value of all entry's in an array of tuples -
i update array, array represents 3x3 grid (1-9)
shape[] shapetransformed = new shape[] { ( new shape (1,'n') ), ( new shape (2,'n') ), ( new shape (3,'n') ), ( new shape (4,'n') ), ( new shape (5,'n') ), ( new shape (6,'n') ), ( new shape (7,'n') ), ( new shape (8,'n') ), ( new shape (9,'n') ) };
i change each 2nd value in tuple new char, have different chars.
what best way this? javascript developer , things thought work giving errors.
thanks :)
this should work you.
for (int row = 0; row < shapetransformed.length; row++) { shapetransformed[row].id = 'd'; }
considering have created shape class as,
class shape { int id; char c; public shape(int id, char c) { super(); this.id = id; this.c = c; } }
Comments
Post a Comment