aspose file tools*
The moose likes Beginning Java and the fly likes little help with assigning values to arrays!! Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "little help with assigning values to arrays!!" Watch "little help with assigning values to arrays!!" New topic
Author

little help with assigning values to arrays!!

prasanth miriyala
Greenhorn

Joined: May 01, 2009
Posts: 5
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

Joined: Sep 29, 2008
Posts: 12617

"[...] 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

Joined: May 01, 2009
Posts: 5
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

Joined: Mar 09, 2009
Posts: 600
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

Joined: Jan 28, 2008
Posts: 5575



yes. As mentioned eariler ,Here x[points] x is your argument x . it is not your array x which is the instance variable
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: little help with assigning values to arrays!!
 
Similar Threads
Swing graphics problems
Is there anyway of overriding the default signal for PopupMenus
awt classes
displaying scroll messages at the bottom of page
Writing Mouse Events