No puede seleccionar más de 25 temas
Los temas deben comenzar con una letra o número, pueden incluir guiones ('-') y pueden tener hasta 35 caracteres de largo.
|
- interface Printable
- method print()
- method tag() as byte
- end interface
-
- interface Resettable
- method reset()
- end interface
-
- class Counter implements Printable, Resettable
- private word value
-
- public method init(start as word)
- self.value = start
- end method
-
- public method print()
- print self.value
- end method
-
- public method tag() as byte
- return 1
- end method
-
- public method reset()
- self.value = 0
- end method
- end class
-
- class Ticker implements Printable
- public method print()
- print 7
- end method
-
- public method tag() as byte
- return 2
- end method
- end class
-
- program Main
- var count as Counter
- var tick as Ticker
- var shown as Printable
- var zeroed as Resettable
- var ok as boolean
-
- count = new Counter(10)
- tick = new Ticker()
- shown = count
- shown.print()
- ok = shown.tag() = 1
- zeroed = count
- zeroed.reset()
- shown = tick
- shown.print()
- ok = shown.tag() = 2
- delete shown
- delete count
- end program
|