Last active
December 15, 2018 09:52
-
-
Save Sottti/e70447e11d722bd01f9b1689c95db08a to your computer and use it in GitHub Desktop.
This file contains hidden or 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
// Overridden.kt | |
public open class User { | |
protected open fun getAge() = 16 | |
} | |
public class Moderator : User() { | |
// getAge() inherits the protected modifier as default | |
override fun getAge() = 18 | |
} | |
public class Staff : User() { | |
// getAge() inherited protected modifier is overriden with public | |
public override fun getAge() = 21 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment