@JvmField annotation

Let's look at the Point class from the java.awt package:

public class Point extends Point2D implements java.io.Serializable {      public int x;    public int y;    private static final long serialVersionUID = -5276940640259749850L;    public Point() {        this(0, 0);    }    public Point(Point p) {        this(p.x, p.y);    }    public Point(int x, int y) {        this.x = x;        this.y = y;    }    public double getX() {        return x;    }    public double getY() {        return y;    }    @Transient    public Point getLocation() {        return new Point(x, y);    }    public void setLocation(Point p) {        setLocation(p.x, p.y);    }    public void setLocation(int x, int y) {        move(x, y);    }    public void setLocation(double x, double y) {        this.x = (int) Math.floor(x+0.5);        this.y = (int) Math.floor(y+0.5);    }    public void ...

Get Mastering High Performance with Kotlin now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.