Tutorial by Examples

class Animal { abstract int maxSize(); // must be implemented by sub-class final float maxSizeInMeters() // can't be overridden by base class { return maxSize() / 100.0; } } class Lion: Animal { override int maxSize() { return 350; } } void main() { ...
class Lion { private double weight; // only accessible with-in class this(double weight) { this.weight = weight; } double weightInPounds() const @property // const guarantees no modifications // @property functions are treated as fields { ret...

Page 1 of 1