In setLocation, i am trying to use an array as the "+" or "-" operator to change the positioning of an object, the operator chosen will be decided by the int which will act as the array's index number, the int xcord or ycord, is changed when the object is intercepting another object, which i have already programmed, however i cannot get greenfoot to recognise the array as an actual operator instead of an int value to use to change the location.
if this does make any sense to you please reply quickly!!
public void omg()
{
x = getX();
y = getY();
String Direction;
Direction = new String;
Direction = "+";
Direction = "-";
setLocation (x (Direction) 2, y (Direction) 2); <--
}

