How to write the following code correctly?
public String toString(int[] position, int xOffset, int yOffset) {
String postn = String.format(\"[%d,%d]\", posit
You cannot return two different values in methods in Java.
When this need occurs, you usually have two options:
Another option would be to use an array of strings, since both your return types are strings. You could use this option as a return value, or a parameter which is altered by the method.
Edit: usually "toString" methods do return only one string. Perhaps you should consider concatenating both your strings into one string using some separator. Example:
return postn + "_" + movm;