Last active
November 28, 2018 07:56
-
-
Save Sottti/e85a0c692b2366460b1528633256796f to your computer and use it in GitHub Desktop.
Kotlin Access Modifiers: private
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
// Private.kt file | |
// Visible just inside this file | |
private const val numberThree = 3 | |
// Visible just inside this file | |
private class User() { | |
// Visible just inside the user class | |
private val numberEight = numberThree.plus(5) | |
} | |
// ERROR: numberEight is not accessible outside the User class | |
private const val numberEleven = numberEight.plus(numberThree) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment