🐦 Kotlin
Beginner
What are Kotlin's visibility modifiers?
Answer
Kotlin has four visibility modifiers. public (default) — visible everywhere. private — visible only within the same class or file. protected — visible within the class and its subclasses (not applicable to top-level declarations). internal — visible within the same compilation module (a Gradle module, Maven artifact, etc.) but not from outside it. The internal modifier is unique to Kotlin and is extremely useful for library development — you can hide implementation details from library consumers while sharing them across multiple files within the library.