Scala is a typesafe programming language that compiles to bytecode on the JVM
class Point(object):
def __init__(self, _x, _y):
self._x = _x; self._y = _y
@property
def x(self):
return self._x
@x.setter
def x(self, value):
self._x = value
@property
def y(self):
return self._y
@y.setter
def y(self, value):
self._y = valuepoint.py
public class Point {
private int x;
private int y;
public Point(int x, int y) {
this.x = x;
this.y = y;
}
public int getX() { return x; }
public int getY() { return y; }
public void setX(int x) { this.x = x; }
public void setY(int y) { this.y = y; }
}Point.java
case class Point(var x: Int, var y: Int)Point.scala
That's it! You're done.
No boilerplate!