Kindly help me to to fix this code for a Java program for:
In the 2- dimensional plane, a point is described by its two coordinates x and y. It supports these operations :
- A constructor allowing initialization of both coordinates
- Accessors and mutators to its coordinates
- Translation of a point
a. Write a Java class, called MyPoint, that corresponds to such an abstraction of points in the dimensional plane.
b. Provide a tester class that creates one point, then translates and displays its new coordinates.
Here is the code:
import java.io.*;
class MyPoint
{
private int x,y;
MyPoint(int x, int y)
{
this.x=x;
this.y=y;
}
int getx()
{
return this.x;
}
int gety()
{
return this.y;
}
void setx(int x)
{
this.x=x;
}
void sety(int y)
{
this.y=y;
}
void translate(int x,int y)
{
this.x=x;
this.y=y;
}
public static void main(String args[])
{
MyPoint P1=new MyPoint(2,3);
}
}