Structures methods in Java

//In Java there are no structures
class Point {
    public int xy;

    public String toText() {
        return String.format("x = %d; y = %d"xy);
    }

    public void move(int rightint down) {
        x += right;
        y += down;
    }
}

Point p1 = new Point();
p1.x = 1;
p1.y = 2;
String str1 = p1.toText();
//str1 is "x = 1; y = 2"

p1.move(5, -1);
String str2 = p1.toText();
//str2 is "x = 6; y = 1"