Overriding toString method

后端 未结 7 506

I am using .toString to return a string representation of an object, i.e.

jcb.engineMove(move.toString());

will produce e2e4.

What

7条回答
  •  借酒劲吻你
    2020-12-12 06:04

    I hope this is not code of toString() method in Move class. The reason of my fear is that you are creating Move object inside of it and invoke recursively toString() method by s+="" + move; (this is same as s+=move.toString()).

提交回复
热议问题