Win a copy of Learn Spring Security (video course) this week in the Spring forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

little help with assigning values to arrays!!

 
prasanth miriyala
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok this seems a bit wierd but I couldnt able to figure out whats wrong with my code:

Problem: I want to assign values to array from another variable but its comes up with an error.

please help me with this

 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"[...] its comes up with an error" is not actually a helpful diagnostic. Telling us *what* the error is makes it much, *much* easier to help.

See the TellTheDetails and ItDoesntWorkIsUseless FAQ entries.

Telling us *specifically* you're trying to do is also helpful--it's hard for us to guess your intent. I will say, however, that any code that writes to an array of bounded length without checking the index before writing is likely to break.
 
prasanth miriyala
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
David Newton wrote:"[...] its comes up with an error" is not actually a helpful diagnostic. Telling us *what* the error is makes it much, *much* easier to help.

See the TellTheDetails and ItDoesntWorkIsUseless FAQ entries.

Telling us *specifically* you're trying to do is also helpful--it's hard for us to guess your intent. I will say, however, that any code that writes to an array of bounded length without checking the index before writing is likely to break.


my apologies my problem is when I'm trying to assign the value to an array (x[points] = x;) at line 16 and line 17 its giving me an error in ecllipse;

error: The type of the expression must be an array type but it resolved to int.

 
John de Michele
Rancher
Posts: 600
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Prasanth:

I see what the error is. Look at the variables in your mouseDown() and mouseUp() methods, and compare them to your array variables. That's where the problem lies.

John.
 
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
Eclipse IDE Java Windows XP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


yes. As mentioned eariler ,Here x[points] x is your argument x . it is not your array x which is the instance variable
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic