Originally Posted by
akira25
"...a public instance method which takes a single int argument and returns no value. The method should first check that its argument is in the range 1 to 6 (inclusive). If it isn't the method should display in a dialogue box a message, if the value of the argument is in the correct range the mehod should send one of the 'face' messages to the recevier, this. For example if the value of the argument is 1, the method should send the message face1() to the receiver etc.."
public int changeFace()
{
int n;
if ((n >= 6) || (n <= 0))
{
OUDialog.alert("Argument to changeFace() message " + (n) +" is out of range");
}
else
{
return this.changeFace(n);
}
}
Hello akira25!
I think you should first make your
changeFace() method match the criteria you are given (which does not as post #2 said). With the
int signature your method should return an
int value but your criteria want it to return no value. And also right now it takes no argument instead of an int argument that is supposed to.
I would suggest you to read the javadoc for
methods and
a useful tutorials.