Closed shweta-code closed 8 years ago
Which particular section of the code do you think will benefit from an StringBuilder implementation? Can you please point me to that?
I think StringBuilder should be used.
Exactly where in the code should StringBuilder be used?
This is the piece of code:
@Override public String toString() { StringBuffer coordinateOutput = new StringBuffer(); coordinateOutput.append(xCoordinate); coordinateOutput.append(" "); coordinateOutput.append(yCoordinate); return coordinateOutput.toString(); }
Thanks. That is a reasonable suggestion. I'll make the change. Alternatively feel free to submit a pull request.
Priyank , I am not able to push. Permission denied.
Yes, you won't be able to push. However you can fork the repo and commit on your version of repo and submit a pull request. More info here
I have created a pull request. https://github.com/priyaaank/MarsRover/pull/2 You can go ahead with merge.
Thank you!
As I see the problem , there is no requirement of Multi-Threaded environment and also there is no such code written for it. Therefore StringBuilder should be used as it has high slightly high performance.