You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

23 lines
375B

  1. interface shape
  2. method area() as word
  3. end interface
  4. class square implements shape
  5. private word side
  6. public method init(s as word)
  7. self.side = s
  8. end method
  9. public method area() as word
  10. return self.side * self.side
  11. end method
  12. end class
  13. program main
  14. var sq as square
  15. var s as shape
  16. sq = new square(4)
  17. s = sq
  18. print s.area()
  19. delete s
  20. end program

Powered by TurnKey Linux.