This site requires JavaScript, please enable it in your browser!
Greenfoot back
Gaddiel
Gaddiel wrote ...

2016/1/7

Sequence Statement Error

1
2
davmac davmac

2016/5/3

#
You are missing a parenthesis. It should be:
if ((getX() == 1023) || (getY() == 340))
Alternatively, you can remove superfluous parentheses:
if (getX() == 1023 || getY() == 340)
danpost danpost

2016/5/3

#
NVM, did not see this next page with response by davmac.
Gaddiel Gaddiel

2016/5/5

#
Also, is there a way to stop a method from acting, when under certain conditions?
Super_Hippo Super_Hippo

2016/5/5

#
Sure:
public void nameOfTheMethod()
{
    if (/*your condition*/) return;
    //rest of the method
}
You need to login to post a reply.
1
2