CJCoding With Joseph

Clone an Object With ICloneable

Complete the Point class so that it implements the ICloneable interface. The Clone method must return a NEW Point object whose X and Y match the current object. Do NOT write a Main method.

The tester clones a point, changes the original, then prints the clone's coordinates as X,Y. For a point with X = 3 and Y = 4 the program prints:

3,4

Expected Output:

3,4
Topics:
Interfaces
Code Editor
1
Tab to indent ยท Ctrl+Enter to run ยท Ctrl+Space to expand shortcuts (cw, cr, fori)

Your Output

Run your code to see the output here...

Test Cases

Run your code to see test case results.