Skip to content

Instantly share code, notes, and snippets.

@alfianyusufabdullah
Created April 28, 2020 08:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alfianyusufabdullah/b633c994f4d32d882bc5a17a4ef6d46e to your computer and use it in GitHub Desktop.
Save alfianyusufabdullah/b633c994f4d32d882bc5a17a4ef6d46e to your computer and use it in GitHub Desktop.
LSP
fun main() {
println("Hello, world!!!")
}
open class Product {
fun setExpireDate(){
}
}
class Smartphone: Product(){
fun setExpiredDate(){
super.setExpireDate()
}
}
class Grocery: Product(){
fun setExpiredDate(){
super.setExpireDate()
}
}
fun main() {
println("Hello, world!!!")
}
open class Product {
}
open class FoodProduct: Product(){
open fun setExpiredDate(){
//TODO
}
}
class Smartphone: Product(){
}
class Grocery: FoodProduct(){
override fun setExpiredDate(){
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment