This week's book giveaway is in the Java in General forum.
We're giving away four copies of Java by Comparison (eBook) and have Simon Harrer, Jörg Lenhard, Linus Dietz on-line!
See this thread for details.
Win a copy of Java by Comparison (eBook) this week in the Java in General forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

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

 
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
 
Ranch Hand
Posts: 192
4
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This link discusses this.
 
Rebecca Wolf
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!
 
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?
 
Oh. Hi guys! Look at this tiny ad:
Thread Boost - a very different sort of advertising
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!