I will give two coordinate points with one set method and I will take them with get method. How can I do this? That's my set method but I can't write a get method for this because it can't return 2 int values. That's my set method
public void setCoordinates(int x,int y)
{
this.x=x;
this.y=y;
}
And I must create two points like this:
public static void main(String[] args)
{
Point p1=new Point();
Point p2=new Point();
p1.setCoordinates(0,8);
p2.setCoordinates(5,3);
System.out.println(p1.getCoordinates()+p2.getCoordinates());
System.out.println(p1.toString()+" "+p2.toString());
}