samples.categories.methods.override.pec Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of WebSite Show documentation
Show all versions of WebSite Show documentation
Prompto Documentation Web Site POM
define Animal as category with attribute name, and methods:
define speak as method doing:
printLine "I'm an animal, I can't speak!"
define Dog as Animal with methods:
define speak as method doing:
printLine "I'm a dog, I bark!"
define Cat as Animal with methods:
define speak as method doing:
printLine "I'm a cat, I meow!"
define main as method doing:
animals = [ Animal, Cat, Dog ]
for each animal in animals:
animal.speak
© 2015 - 2024 Weber Informatics LLC | Privacy Policy