Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Java error

 
nina
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I need help to fix the error in the following code:
int s = shape[i];
for (int p = 0; p <shape.length - 1; p++)
shape[p] = shape[p+1];
shape[shape.length - 1] = s;
{
}
The compiler says there is an error with the int function and I dont know what other function to use.
If this helps, here is an example of shape[i]
new Circle(40, 40, 30, Color.red),
 
Manfred Leonhardt
Ranch Hand
Posts: 1492
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
First off, regarding your user name it is not valid here at the ranch. Please read the naming policy here and re-register with a valid name. We like to keep professional here and that means firstName + space + lastName. Thanks.
Second, are you sure that Shape[i] is an integer. From your last sentence, it would seem to be a Circle object and, of course, you can't assign an object to an integer.
Regards,
Manfred.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic