Created
June 9, 2020 00:48
-
-
Save nooglersoon/cc36e19ceefb6102e8b95d58750ebb5f to your computer and use it in GitHub Desktop.
Medium Session: Introduction to Swift's OOP in Indonesia - Part 2F
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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