daily pastebin goal
55%
SHARE
TWEET

Untitled

a guest Dec 7th, 2017 46 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Class Material
  2.     Private String _type
  3.  
  4.     Public Module Material(String type)
  5.         _type = type
  6.     End Module
  7.  
  8.     Public Module display()
  9.         Display _type
  10.     End Module
  11. End Class
  12.  
  13. Class Furniture
  14.     Private Material _material
  15.     Private String _type
  16.  
  17.     Public Module set_material(Material material)
  18.         Set _material = material
  19.     End Module
  20.  
  21.     Public Module display()
  22.         Display _type
  23.         Call _material.display()
  24.     End Module
  25. End Class
  26.  
  27. Class Chair Extends Furniture
  28.     Public Module Chair()
  29.         Set _type = "Chair"
  30.     End Module
  31. End Class
  32.  
  33. Module main()
  34.     Declare Furniture furniture = New Chair()
  35.  
  36.     Call furniture.set_material(New Material("Wood"))
  37.     Call furniture.display()
  38. End Module
RAW Paste Data
Top