class Base is abstract private, shared def foo pass shared def bar .foo abstract, protected def baz class Derived inherits Base def baz is override, protected pass def main is shared .bar d = Derived() d.baz