Stenway Developer Network

abstract Keyword

Modifier

Abstract Classes

namespace MyLib
  abstract class MyAbstractClass
  
  end
end

Abstract classes cannot be instantiated.

Abstract Methods

namespace MyLib
  abstract class BaseClass
    abstract method doSomething()
  end
  
  class MyClass extends BaseClass
    method doSomething()
      # implementation here
    end
  end
end

Abstract Properties

namespace MyLib
  abstract class BaseClass
    abstract property MyProperty
    abstract readonly property MyProperty2
  end
  
  class MyClass extends BaseClass
    property MyProperty
      get : return 123
      set : # do something
    end
    
    readonly property MyProperty2
      return 234
    end
  end
end