• Post Reply Bookmark Topic Watch Topic
  • New Topic

Can't assign new value to an array?  RSS feed

 
Shane Jensen
Ranch Hand
Posts: 113
7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Is it not possible to assign a new value to an array?

The following code:


Outputs the following error:


Shouldn't this be possible? Or am I doing something wrong here?

Thanks again!

Shane
 
Charles O'Leary
Ranch Hand
Posts: 185
4
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This link discusses this.
 
Shane Jensen
Ranch Hand
Posts: 113
7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Charles O'Leary wrote:This link discusses this.

Hi Charles,

Thanks, makes a lot of sense!
 
Roel De Nijs
Sheriff
Posts: 11338
177
AngularJS Chrome Eclipse IDE Hibernate Java jQuery MySQL Database Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And what about assigning a new value to each element in an array? What will be the result of this code snippet?
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!