Skip to content

Instantly share code, notes, and snippets.

@riccjohn
Created November 20, 2019 17:50
Show Gist options
  • Save riccjohn/fc4dbfbe4f3ac15d3070d06cace9efd3 to your computer and use it in GitHub Desktop.
Save riccjohn/fc4dbfbe4f3ac15d3070d06cace9efd3 to your computer and use it in GitHub Desktop.
class Dog {
func bark() {
print("woof!")
}
func eat() {
print("nom nom nom")
}
}
class Robot {
func clean() {
print("Cleaning! beep boop")
}
}
let Quinn = Dog()
Quinn.bark() // "woof!"
Quinn.eat() // "nom nom nom"
let Alfred = Robot()
Alfred.clean() // "Cleaning! beep boop"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment