Skip to content

Instantly share code, notes, and snippets.

@nooglersoon
Created June 9, 2020 00:48
Show Gist options
  • Save nooglersoon/cc36e19ceefb6102e8b95d58750ebb5f to your computer and use it in GitHub Desktop.
Save nooglersoon/cc36e19ceefb6102e8b95d58750ebb5f to your computer and use it in GitHub Desktop.
Medium Session: Introduction to Swift's OOP in Indonesia - Part 2F
class Sedan: Mobil { // -> Class Toyota merupakan subclass atau child class, sementara Mobil adalah superclass atau parent class
// Melakukan override methods pada playEntertainment, dengan parameter baru dan isi dari methods ikut diubah
override func playEntertainment(_ dvdPlayer: Bool) -> String {
if dvdPlayer {
return "Your Sedan dvd player is now playing!"
}else{
return "You are not yet play the video"
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment